parent
7a3ac5203b
commit
ac3ace5a56
5 changed files with 176 additions and 84 deletions
@ -0,0 +1,72 @@ |
||||
.exchange_sucess_mask { |
||||
position: fixed; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
background-color: rgba(0, 0, 0, 0.5); |
||||
z-index: 999; |
||||
} |
||||
|
||||
.exchangee_sucess_modal { |
||||
position: fixed; |
||||
top: 50%; |
||||
left: 50%; |
||||
transform: translate(-50%, -50%); |
||||
width: calc(18rem - 2rem); |
||||
background: #fff; |
||||
border-radius: 1rem; |
||||
display: flex; |
||||
flex-direction: column; |
||||
padding: .9375rem 1rem; |
||||
z-index: 1000; |
||||
gap: .5rem; |
||||
|
||||
.exchange_header { |
||||
width: 100%; |
||||
height: 1.625rem; |
||||
display: flex; |
||||
|
||||
.exchange_close { |
||||
width: 1.5rem; |
||||
height: 1.5rem; |
||||
margin: auto 0 auto auto; |
||||
background-image: url(https://oss.jm-kid.com/wx_5colorflower/close.png); |
||||
background-size: cover; |
||||
background-repeat: no-repeat; |
||||
} |
||||
} |
||||
|
||||
.exchange_content { |
||||
display: flex; |
||||
margin-bottom: 1rem; |
||||
} |
||||
.exchange_suc { |
||||
font-size: .9rem; |
||||
color: #333; |
||||
white-space: nowrap; |
||||
} |
||||
.exchange_prod_name { |
||||
margin-bottom: .3rem; |
||||
font-size: .9rem; |
||||
color: #3ba366; |
||||
} |
||||
|
||||
.exchange_exchange { |
||||
width: 10rem; |
||||
height: 2rem; |
||||
border-radius: 1rem; |
||||
background-color: #3ba366; |
||||
margin: 0 auto; |
||||
display: flex; |
||||
|
||||
.exchange_exchange_text { |
||||
width: auto; |
||||
font-size: 1rem; |
||||
font-weight: 600; |
||||
color: #fff; |
||||
text-align: center; |
||||
margin: auto; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,64 @@ |
||||
import Taro from '@tarojs/taro' |
||||
import { View, Text } from '@tarojs/components' |
||||
import './index.less' |
||||
|
||||
interface Props{ |
||||
isOpen: boolean, |
||||
setIsOpen: (isOpen: boolean) => void, |
||||
prdtNames: string, |
||||
prdtList: any[] |
||||
} |
||||
|
||||
export default function UserExchangeModal({ isOpen, setIsOpen, prdtNames, prdtList }: Props) { |
||||
const handleExchange = () => { |
||||
if(prdtList[0].PrdtType === '03'){ |
||||
Taro.navigateTo({ |
||||
url: '/pages/ListenDetail/index?prdtId=' + prdtList[0].PrdtId |
||||
}) |
||||
}else if(prdtList[0].PrdtType === '05'){ |
||||
Taro.navigateTo({ |
||||
url: '/pages/CollectionDetail/index?id=' + prdtList[0].PrdtId |
||||
}) |
||||
} |
||||
} |
||||
|
||||
if(!isOpen){ |
||||
return null |
||||
} |
||||
|
||||
return ( |
||||
<> |
||||
<View |
||||
className='exchange_sucess_mask' |
||||
onClick={() => setIsOpen(false)} |
||||
></View> |
||||
<View className='exchangee_sucess_modal'> |
||||
<View className='exchange_header'> |
||||
<View className='exchange_title'></View> |
||||
<View |
||||
className='exchange_close' |
||||
onClick={() => setIsOpen(false)} |
||||
></View> |
||||
</View> |
||||
|
||||
{ |
||||
prdtList.length ? |
||||
<View |
||||
className='exchange_content' |
||||
> |
||||
<Text className='exchange_suc'>兑换成功:</Text> |
||||
<Text className='exchange_prod_name'>{prdtNames}</Text> |
||||
</View> : |
||||
null |
||||
} |
||||
|
||||
<View |
||||
className='exchange_exchange' |
||||
onClick={handleExchange} |
||||
> |
||||
<Text className='exchange_exchange_text'>立即阅读</Text> |
||||
</View> |
||||
</View> |
||||
</> |
||||
) |
||||
} |
Loading…
Reference in new issue