yujialong 1 month ago
parent ac3ace5a56
commit fd2e0c400c
  1. 79
      src/components/UserExchangeModal/index.tsx
  2. 4
      src/components/UserExchangeSuccessModal/index.tsx
  3. 2
      src/pages/Home/index.less
  4. 15
      src/pages/Listen/index.less
  5. 11
      src/pages/ListenSearch/index.tsx
  6. 8
      src/pages/SearchDetail/index.less
  7. 3
      src/pages/SearchDetail/index.tsx
  8. 9
      src/pages/Subscribe/index.less
  9. 3
      src/pages/Subscribe/index.tsx
  10. 5
      src/pages/UserHome/index.less

@ -33,10 +33,9 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
//唤起扫码
const handleScanCode = () => {
console.log('唤起扫码')
Taro.scanCode({
success: (res: any) => {
console.log(res.path.slice(-8))
console.log('唤起扫码:',res,res.path)
if(!Taro.getStorageSync('UserToken')){
setisLoginOpen(true)
setuserScene(res.path.slice(-8))
@ -89,12 +88,13 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
change_code: inputValue
},
success: (res: any) => {
console.log('兑换成功=>', res.data)
if(res.data.state === '200'){
const list = res.data.data.Subscribed
console.log('兑换成功=>', list)
setPrdtNames(list.map((e: any) => e.PrdtTitle).join(';'))
setPrdtList(list)
setIsOpen(false)
setisUserExchangeSuccessModalOpen(true)
}else if(res.data.state === '207'){
Taro.showToast({
title: '兑换码已使用',
@ -115,50 +115,51 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
}
if(!isOpen){
return null
}
return (
<>
<View
className='exchange_mask'
onClick={() => setIsOpen(false)}
></View>
<View className='exchange_modal'>
<View className='exchange_header'>
<View className='exchange_title'></View>
{
isOpen && (
<View>
<View
className='exchange_close'
className='exchange_mask'
onClick={() => setIsOpen(false)}
></View>
<View className='exchange_modal'>
<View className='exchange_header'>
<View className='exchange_title'></View>
<View
className='exchange_close'
onClick={() => setIsOpen(false)}
></View>
</View>
<View
className='exchange_scan'
onClick={handleScanCode}
></View>
<Input
className='exchange_input'
placeholder='请输入兑换码兑换商品'
value={inputValue}
onInput={(e) => setinputValue(e.detail.value)}
></Input>
<View
className='exchange_exchange'
onClick={handleExchange}
>
<Text className='exchange_exchange_text'></Text>
</View>
</View>
<GetPhoneNumber
onClose={setisGetUsePhone}
scene={userScene}
modalVisible={isLoginOpen}
onModalClose={() => setisLoginOpen(false)}
></GetPhoneNumber>
</View>
<View
className='exchange_scan'
onClick={handleScanCode}
></View>
<Input
className='exchange_input'
placeholder='请输入兑换码兑换商品'
value={inputValue}
onInput={(e) => setinputValue(e.detail.value)}
></Input>
<View
className='exchange_exchange'
onClick={handleExchange}
>
<Text className='exchange_exchange_text'></Text>
</View>
</View>
)}
<UserExchangeSuccessModal prdtList={prdtList} prdtNames={prdtNames} isOpen={isUserExchangeSuccessModalOpen} setIsOpen={setisUserExchangeSuccessModalOpen}></UserExchangeSuccessModal>
<GetPhoneNumber
onClose={setisGetUsePhone}
scene={userScene}
modalVisible={isLoginOpen}
onModalClose={() => setisLoginOpen(false)}
></GetPhoneNumber>
</>
)
}

@ -11,11 +11,13 @@ interface Props{
export default function UserExchangeModal({ isOpen, setIsOpen, prdtNames, prdtList }: Props) {
const handleExchange = () => {
if(prdtList[0].PrdtType === '03'){
if (prdtList[0].PrdtType === '03') {
setIsOpen(false)
Taro.navigateTo({
url: '/pages/ListenDetail/index?prdtId=' + prdtList[0].PrdtId
})
}else if(prdtList[0].PrdtType === '05'){
setIsOpen(false)
Taro.navigateTo({
url: '/pages/CollectionDetail/index?id=' + prdtList[0].PrdtId
})

@ -168,7 +168,7 @@
&:not(:last-child) {
padding-bottom: 1rem;
margin-bottom: 1rem;
border-bottom: 6px solid #efefef;
border-bottom: 2px solid #efefef;
}
.hot_info {

@ -99,7 +99,6 @@
.item {
width: 100%;
height: 12.5rem;
display: flex;
flex-direction: column;
gap: 1rem;
@ -133,8 +132,8 @@
background-repeat: no-repeat;
background-size: contain;
margin: auto 0 auto 0;
}
}
}
.selection {
@ -172,8 +171,8 @@
width: 100%;
height: 0;
top: 0;
left: 0;
left: 0;
.free_item_label {
position: absolute;
left: calc(100% - 3rem);
@ -183,15 +182,15 @@
border-radius: .75rem 0;
background-color: #fcca1e;
display: flex;
.free_item_label_text {
font-size: .5rem;
margin: auto;
}
}
}
}
}
}
}
}
}
}

@ -1,9 +1,8 @@
import { Input, View, Image, Text, ScrollView } from '@tarojs/components'
import Taro, { useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro'
import React, { useState, useEffect } from 'react'
import searchIcon from '../../assets/images/searchIcon.png'
import empty from '../../assets/images/empty.svg'
import './index.less'
import DefaultPage3 from '../../components/defaultPage3'
export default function SearchDetail() {
@ -163,13 +162,7 @@ export default function SearchDetail() {
}
</View>
</ScrollView> :
<View className='none'>
<Image
className='icon'
src={empty}
></Image>
<View></View>
</View>
searchText && <DefaultPage3></DefaultPage3>
}
</View>
)

@ -121,7 +121,7 @@
display: grid;
grid-template-columns: repeat(3, 1fr);
// height: auto;
gap: .625rem;
gap: .8rem .625rem;
.subscribe_content_singleItem {
width: 100%;
@ -171,7 +171,6 @@
.subscribe_content_collectionItem {
width: 100%;
height: calc(((100vw - 2rem - .625rem) / 2) * .5625 + .5rem + 2rem);
display: flex;
flex-direction: column;
@ -201,14 +200,13 @@
.subscribe_content_singleItem_cover {
width: 100%;
height: calc(((100vw - 2rem - .625rem) / 2) * .5625);
height: 5.8rem;
border-radius: .75rem;
margin-bottom: .625rem;
}
.subscribe_content_singleItem_title {
width: calc(((100vw - 2rem - .625rem) / 2));
height: 1.25rem;
line-height: 1.25rem;
font-size: .875rem;
font-weight: 600;
@ -219,7 +217,7 @@
}
.subscribe_content_collectionItem_count {
height: .625rem;
margin-top: .3rem;
line-height: .625rem;
font-size: .625rem;
color: rgba(0, 0, 0, .3);

@ -249,7 +249,6 @@ export default function SearchDetail() {
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='widthFix'
lazyLoad
></Image>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
@ -259,7 +258,7 @@ export default function SearchDetail() {
}
</View>
</ScrollView> :
searchText && <DefaultPage3></DefaultPage3>
searchText && <DefaultPage3></DefaultPage3>
}
</View>
)

@ -126,7 +126,7 @@
display: grid;
grid-template-columns: repeat(3, 1fr);
// height: auto;
gap: .625rem;
gap: .8rem .625rem;
.subscribe_content_singleItem {
width: 100%;
@ -160,7 +160,6 @@
.subscribe_content_singleItem_cover {
width: 100%;
height: calc((100vw - 2rem - 1.25rem) / 3);
border-radius: .75rem;
margin-bottom: auto;
}
@ -176,7 +175,6 @@
.subscribe_content_collectionItem {
width: 100%;
height: calc(((100vw - 2rem - .625rem) / 2) * .5625 + .5rem + 2rem);
display: flex;
flex-direction: column;
@ -206,14 +204,13 @@
.subscribe_content_singleItem_cover {
width: 100%;
height: calc(((100vw - 2rem - .625rem) / 2) * .5625);
height: 5.8rem;
border-radius: .75rem;
margin-bottom: .625rem;
}
.subscribe_content_singleItem_title {
width: calc(((100vw - 2rem - .625rem) / 2));
height: 1.25rem;
line-height: 1.25rem;
font-size: .875rem;
font-weight: 600;
@ -224,7 +221,7 @@
}
.subscribe_content_collectionItem_count {
height: .625rem;
margin-top: .3rem;
line-height: .625rem;
font-size: .625rem;
color: rgba(0, 0, 0, .3);

@ -566,7 +566,7 @@ export default function Subscribe() {
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='aspectFill'
mode='widthFix'
lazyLoad
></Image>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
@ -593,7 +593,6 @@ export default function Subscribe() {
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='widthFix'
lazyLoad
></Image>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>

@ -54,7 +54,6 @@
}
.user_home_content {
width: calc(100% - 2rem);
height: auto;
min-height: calc(100% - 6.25rem - 3rem - 2rem);
display: flex;
@ -69,7 +68,7 @@
flex-direction: row;
padding: 0;
background-color: #fff;
.user_home_content_item_icon {
width: 2.5rem;
height: 2.5rem;
@ -96,4 +95,4 @@
border: 0;
}
}
}
}

Loading…
Cancel
Save