yujialong 1 month ago
parent da5a298472
commit 7a3ac5203b
  1. 10
      src/components/UserExchangeModal/index.less
  2. 26
      src/components/UserExchangeModal/index.tsx
  3. 30
      src/components/defaultPage2/index.tsx
  4. 12
      src/components/defaultPage3/index.less
  5. 23
      src/pages/DisplayVideo/index.less
  6. 16
      src/pages/DisplayVideo/index.tsx
  7. 34
      src/pages/Home/index.less
  8. 2
      src/pages/ListenType/MainType/index.less
  9. 2
      src/pages/ListenType/SingleType/index.less
  10. 18
      src/pages/SearchDetail/index.tsx
  11. 24
      src/pages/SingleDetail/index.tsx
  12. 68
      src/pages/Subscribe/index.less
  13. 110
      src/pages/Subscribe/index.tsx
  14. 9
      src/pages/UserHome/UserPersonalInfo/index.less
  15. 30
      src/pages/UserHome/UserPersonalInfo/index.tsx
  16. 28
      src/pages/UserHome/UserSubscribe/index.tsx
  17. 34
      src/pages/UserHome/index.tsx

@ -14,7 +14,6 @@
left: 50%;
transform: translate(-50%, -50%);
width: calc(18rem - 2rem);
height: calc(15rem - 1.875rem);
background: #fff;
border-radius: 1rem;
display: flex;
@ -57,9 +56,12 @@
.exchange_input {
width: 100%;
height: 2rem;
margin: 0 auto;
height: 2.3rem;
padding: .6rem .5rem;
margin: .5rem auto;
font-size: .9rem;
background-color: #f8f8f8;
box-sizing: border-box;
}
.exchange_exchange {
@ -79,4 +81,4 @@
margin: auto;
}
}
}
}

@ -10,7 +10,7 @@ interface Props{
}
export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
const [inputValue, setinputValue] = useState('')
const [userScene, setuserScene] = useState<any>(null)
@ -48,7 +48,7 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
s_res.data.data.Subscribed.forEach(element => {
modalContent += `${element.PrdtTitle};`
})
Taro.showModal({
title: '兑换成功',
content: modalContent,
@ -83,7 +83,7 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
}
})
}
}
})
}
@ -148,40 +148,40 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) {
icon: 'none'
})
}
}
if(!isOpen){
return null
}
return (
<>
<View
<View
className='exchange_mask'
onClick={() => setIsOpen(false)}
></View>
<View className='exchange_modal'>
<View className='exchange_header'>
<View className='exchange_title'></View>
<View
className='exchange_close'
<View
className='exchange_close'
onClick={() => setIsOpen(false)}
></View>
</View>
<View
<View
className='exchange_scan'
onClick={handleScanCode}
></View>
<Input
className='exchange_input'
<Input
className='exchange_input'
placeholder='请输入兑换码兑换商品'
value={inputValue}
onInput={(e) => setinputValue(e.detail.value)}
onInput={(e) => setinputValue(e.detail.value)}
></Input>
<View
className='exchange_exchange'
onClick={handleExchange}
onClick={handleExchange}
>
<Text className='exchange_exchange_text'></Text>
</View>

@ -1,31 +1,31 @@
import { View, Text, Image } from '@tarojs/components'
import { useState } from 'react'
import Taro from '@tarojs/taro';
import './index.less'
import GoToStoreModal from '../goToStoreModal'
export default function DefaultPage2() {
const handleNavigateToMiniProgram = () => {
Taro.navigateToMiniProgram({
appId: 'wxbd3d383851fea776',
path: 'pages/home/dashboard/index',
success: (res) => {
console.log('打开成功=>',res)
},
fail: (res) => {
console.log('打开失败=>',res)
}
})
}
const [isToStoreOpen, setisToStoreOpen] = useState(false)
return (
<View className='default1_bg'>
<Image src='https://oss.jm-kid.com/wx_5colorflower/defaultBg2.png' className='default1_img'></Image>
<Text className='default1_context'>~</Text>
<View
<View
className='default1_btn'
onClick={()=>{
setisToStoreOpen(true)
}}
onClick={handleNavigateToMiniProgram}
>
<Text className='default1_btn_text'>~</Text>
</View>
<GoToStoreModal
visible={isToStoreOpen}
onClose={() => setisToStoreOpen(false)}
type={0}
setmallLink={()=>{}}
></GoToStoreModal>
</View>
)
}

@ -1,19 +1,15 @@
.default3_bg {
display: flex;
height: 100%;
width: 100%;
flex-direction: column;
margin: auto;
gap: 1.25rem;
justify-content: center;
align-items: center;
padding-top: 2rem;
.default1_img {
width: 15.625rem;
height: 15.625rem;
margin: auto auto 1rem auto;
}
.default1_context {
margin: 0 auto auto auto;
color: black;
font-size: .875rem;
font-weight: 600;
@ -33,4 +29,4 @@
// font-size: .875rem;
// }
// }
}
}

@ -20,7 +20,7 @@
.displayList {
// width: 100vw;
// height: 100vh;
// display: flex;
// display: flex;
// align-items: center;
// margin-top: 12.5rem;
height: calc(100vh - 100vw * .5625);
@ -33,16 +33,19 @@
width: 100vw;
height: 6rem;
display: flex;
justify-content: space-between;
padding-right: .75rem;
.card-left {
display: inline-flex;
align-items: center;
}
.card-image {
// object-fit: cover; wechatapp中object-fit属性不生效
width: 8rem;
height: 4.5rem;
border-radius: 1rem;
margin-top: .75rem;
margin-bottom: .75rem;
margin-left: 1.5rem;
margin-right: .75rem;
margin: .75rem;
}
.card-textarea {
@ -69,7 +72,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: flex;
display: flex;
.content-icon {
width: .9375rem;
@ -91,11 +94,9 @@
}
.card-button {
// margin-top: 2.3125rem;
// margin-left: auto;
margin: 2.0625rem 0 0;
margin: 2.0625rem 1.2rem 0 0;
width: 1.875rem;
height: 1.875rem;
}
}
}
}

@ -394,14 +394,16 @@ export default function Index() {
{
alldata.map((item : any, index: number) =>
<View className='card' key={item['ResId']} style={index == displayindex['index'] ? { backgroundColor: '#efefef' } : {}} onClick={() => changedisplay(item, index)} >
<Image className='card-image' src={item['ResCover']} mode='aspectFill'></Image>
<View className='card-textarea'>
<Text className='card-textarea-title'>{item['ResTitle']}</Text>
<View className='card-textarea-content'>
<Image src='https://oss.jm-kid.com/wx_5colorflower/testIcon.svg' className='content-icon'></Image>
<Text className='content-text'>{getDuration(item['ResDuration'])}</Text>
<View className='card-left'>
<Image className='card-image' src={item['ResCover']} mode='aspectFill'></Image>
<View className='card-textarea'>
<Text className='card-textarea-title'>{item['ResTitle']}</Text>
<View className='card-textarea-content'>
<Image src='https://oss.jm-kid.com/wx_5colorflower/testIcon.svg' className='content-icon'></Image>
<Text className='content-text'>{getDuration(item['ResDuration'])}</Text>
</View>
</View>
</View>
</View>
<Image className='card-button' src={isplay && displayindex['index'] == index ? 'https://oss.jm-kid.com/wx_5colorflower/newplay.gif' : 'https://oss.jm-kid.com/wx_5colorflower/button_01.svg'}></Image>
</View>
)

@ -7,7 +7,7 @@
.home_swiper {
width: 100vw;
height: calc(100vw * .5625);
height: calc(100vw * .5625);
background: #000;
// background-image: url(https://oss.jm-kid.com/wx_5colorflower/banner1.png);
// background-repeat: no-repeat;
@ -25,7 +25,7 @@
.swiper_item_img {
width: 100%;
height: 100%;
}
}
}
}
}
@ -74,7 +74,7 @@
.free_item_label_text {
font-size: .5rem;
margin: auto;
}
}
}
}
@ -84,7 +84,7 @@
border-radius: .75rem;
margin-bottom: .5rem;
}
.free_item_title {
width: calc(((100vw - 2rem - 1.25rem) / 3));
height: 2.5rem;
@ -114,7 +114,7 @@
background: linear-gradient(to right, #329C5E, #3BA366);
display: flex;
margin: .5rem auto .5rem auto;
.home_single_checkMore_text {
color: #fff;
font-size: .75rem;
@ -128,7 +128,7 @@
.home_hot_container {
width: calc(100% - 2rem);
height: auto;
padding: 0 1rem;
padding: 1rem 1rem 0;
display: flex;
flex-direction: column;
background: #fff;
@ -138,8 +138,8 @@
width: 6rem;
height: 1.5rem;
display: flex;
margin-bottom: 1rem;
align-items: center;
.home_hot_title_text {
line-height: 1.5rem;
font-size: 1rem;
@ -165,6 +165,12 @@
display: flex;
flex-direction: column;
&:not(:last-child) {
padding-bottom: 1rem;
margin-bottom: 1rem;
border-bottom: 6px solid #efefef;
}
.hot_info {
width: 100%;
height: auto;
@ -231,20 +237,20 @@
height: auto;
gap: .625rem;
background: #fff;
.hot_details_item {
width: 100%;
height: calc((100vw - 2rem - 1.25rem) / 3 + .5rem + 2.5rem);
display: flex;
flex-direction: column;
.hot_details_item_cover {
width: 100%;
height: calc((100vw - 2rem - 1.25rem) / 3);
border-radius: .75rem;
margin-bottom: .5rem;
}
.hot_details_item_title {
width: calc(((100vw - 2rem - 1.25rem) / 3));
height: 2.5rem;
@ -259,8 +265,8 @@
}
}
}
}
}
}
}

@ -57,7 +57,7 @@
.typelist {
height: calc(100vh - 2.5rem);
padding: 0 .7rem;
padding: 0 0.7rem 0 1rem;
.item {
width: 100%;

@ -40,7 +40,7 @@
.typelist {
height: calc(100vh - 6.5rem - 1rem);
padding: 0 .7rem;
padding: 0 0.7rem 0 1rem;
.item {
width: 100%;

@ -1,8 +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 empty from '../../assets/images/empty.svg'
import './index.less'
import DefaultPage3 from '../../components/defaultPage3'
export default function SearchDetail() {
@ -43,12 +43,12 @@ export default function SearchDetail() {
// 搜索逻辑
const handleSearch = () => {
//搜索单本结果
const searchSingle = userSubscribeSingleList.filter(( item:any ) => item.PrdtTitle.includes(searchText))
const searchSingle = searchText ? userSubscribeSingleList.filter(( item:any ) => item.PrdtTitle.includes(searchText)) : []
console.log('searchSingle=>', searchSingle)
setSearchSingleResults(searchSingle)
//搜索套装结果
const searchCollection = userSubscribeCollectionList.filter(( item:any ) => item.PrdtTitle.includes(searchText))
const searchCollection = searchText ? userSubscribeCollectionList.filter(( item:any ) => item.PrdtTitle.includes(searchText)) : []
console.log('searchCollection=>', searchCollection)
setsearchCollectionResults(searchCollection)
};
@ -222,7 +222,7 @@ export default function SearchDetail() {
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='aspectFill'
mode='widthFix'
lazyLoad
></Image>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
@ -249,7 +249,7 @@ export default function SearchDetail() {
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='aspectFit'
mode='widthFix'
lazyLoad
></Image>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
@ -259,13 +259,7 @@ export default function SearchDetail() {
}
</View>
</ScrollView> :
<View className='none'>
<Image
className='icon'
src={empty}
></Image>
<View></View>
</View>
searchText && <DefaultPage3></DefaultPage3>
}
</View>
)

@ -20,7 +20,7 @@ const tabbarList = [
{
tabIndex: 2,
name: '听绘本',
cover: 'https://oss.jm-kid.com/wx_5colorflower/detailsTabbar3.png',
cover: 'https://oss.jm-kid.com/wx_5colorflower/detailsTabbar4.png',
url: '/pages/ListenBookDisplay/index',
},
// {
@ -121,7 +121,7 @@ export default function SingleDetail() {
},
success: (res) => {
console.log('产品资源获取成功=>', res.data)
if(res.data.data.StoryResource.length > 0){
setisListenBook(true)
}
@ -173,7 +173,7 @@ export default function SingleDetail() {
url: url + `?id=${singleDetail?.PrdtId}`
})
}
}
return (
@ -181,11 +181,11 @@ export default function SingleDetail() {
<ScrollView
className='single_detail'
scrollY
scrollWithAnimation
scrollWithAnimation
>
<View
<View
className='single_back'
style={{top: navigationBarHeight}}
style={{top: navigationBarHeight}}
onClick={()=>{Taro.navigateBack()}}
></View>
@ -199,13 +199,13 @@ export default function SingleDetail() {
</View>
{
singleDetail && <Image
singleDetail && <Image
className='single_bg'
src={singleDetail.PrdtCover}
mode='aspectFill'
></Image>
}
<View className='single_container'>
<View className='single_title'>{singleDetail?.PrdtTitle}</View>
<View className='single_label_container'>
@ -220,7 +220,7 @@ export default function SingleDetail() {
))
}
</View>
<View className='single_fixedTitle'></View>
<View className='single_intro'>{singleDetail?.PrdtDescription}</View>
<View className='single_fixedTitle'></View>
@ -241,7 +241,7 @@ export default function SingleDetail() {
{/* <View className='single_tabbar'>
{
tabbarList.map((item: any, index: number) => (
<View
<View
className='single_tabbar_item'
key={index}
onClick={() => handleNavigateTo(item.url)}
@ -260,7 +260,7 @@ export default function SingleDetail() {
<View className='single_tabbar'>
{
tabbarList.map((item: any, index: number) => (
<View
<View
className='single_tabbar_item'
key={index}
onClick={() => handleNavigateTo(item.url)}
@ -276,6 +276,6 @@ export default function SingleDetail() {
}
</View>
</>
)
}

@ -88,7 +88,7 @@
}
}
}
}
@ -114,9 +114,13 @@
.subscribe_content {
width: 100%;
height: calc(100% - 3.75rem - 2.5rem);
height: calc(100% - 3.75rem - 5.8rem);
display: flex;
flex-direction: column;
&.empty {
height: auto;
margin-bottom: 1rem;
}
.subscribe_container {
display: grid;
@ -146,11 +150,11 @@
border-radius: .75rem 0;
background-color: #fcca1e;
display: flex;
.subscribe_content_singleItem_label_text {
font-size: .5rem;
margin: auto;
}
}
}
}
@ -160,7 +164,7 @@
border-radius: .75rem;
margin-bottom: auto;
}
.subscribe_content_singleItem_title {
width: 100%;
height: 2.5rem;
@ -192,11 +196,11 @@
border-radius: .75rem 0;
background-color: #fcca1e;
display: flex;
.subscribe_content_singleItem_label_text {
font-size: .5rem;
margin: auto;
}
}
}
}
@ -206,7 +210,7 @@
border-radius: .75rem;
margin-bottom: .625rem;
}
.subscribe_content_singleItem_title {
width: calc(((100vw - 2rem - .625rem) / 2));
height: 1.25rem;
@ -244,30 +248,30 @@
}
}
}
}
.subscribe_footer {
width: 100%;
height: 2.5rem;
display: flex;
flex-direction: column;
margin-top: auto;
.subscribe_footer_tips {
// height: 1.25rem;
line-height: 1.125rem;
font-size: .75rem;
color: rgba(0, 0, 0, .3);
text-align: center;
}
.subscribe_footer_add {
// height: 1.25rem;
line-height: 1.125rem;
font-size: .75rem;
font-weight: 600;
color: #3ba366;
text-align: center;
}
.subscribe_footer {
width: 100%;
height: 2.5rem;
display: flex;
flex-direction: column;
margin-top: .5rem;
.subscribe_footer_tips {
margin-bottom: .1rem;
line-height: 1.125rem;
font-size: .75rem;
color: rgba(0, 0, 0, .3);
text-align: center;
}
.subscribe_footer_add {
// height: 1.25rem;
line-height: 1.125rem;
font-size: .75rem;
font-weight: 600;
color: #3ba366;
text-align: center;
}
}
}
}

@ -100,7 +100,7 @@ export default function Subscribe() {
for(let item of res.data.data.FreeProducts){
b++
for(let sec_item of item.Child){
if(!singleArr.some((arr_item : any) => arr_item === sec_item)){
@ -172,7 +172,7 @@ export default function Subscribe() {
let singleArr: any = []
for(let item of res.data.data.FreeProducts){
for(let sec_item of item.Child){
if(!singleArr.some((arr_item : any) => arr_item === sec_item)){
@ -217,7 +217,7 @@ export default function Subscribe() {
}
})
}
}
}, [isFilter])
@ -257,7 +257,7 @@ export default function Subscribe() {
for(let item of res.data.data.FreeProducts){
b++
for(let sec_item of item.Child){
if(!singleArr.some((arr_item : any) => arr_item.PrdtId === sec_item.PrdtId)){
@ -391,7 +391,7 @@ export default function Subscribe() {
s_res.data.data.Subscribed.forEach(element => {
modalContent += `兑换成功: ${element.PrdtTitle}\n`
})
Taro.showModal({
title: '兑换成功',
content: modalContent,
@ -417,7 +417,7 @@ export default function Subscribe() {
}
})
}
}
})
}
@ -478,24 +478,25 @@ export default function Subscribe() {
})
}
}
return (
<View className='subscribe_bg'>
<View className='subscribe_header'>
<View
<View
className='subscribe_header_searchContainer'
>
</View>
<Input
className='subscribe_header_input'
<Input
className='subscribe_header_input'
placeholder='请输入绘本名称'
value={searchValue}
disabled
confirmType='search'
onConfirm={() => handleSearch()}
onInput={(e) => {
setsearchValue(e.detail.value)
}}
onClick={() => handleSearchToDetail()}
}}
onClick={() => handleSearchToDetail()}
></Input>
<View
className='subscribe_header_dressing'
@ -508,25 +509,25 @@ export default function Subscribe() {
></Image>
</View>
<PopupHalfScreen
visible={isPopupOpen}
<PopupHalfScreen
visible={isPopupOpen}
onClose={() => setisPopupOpen(!isPopupOpen)}
isfilter={isFilter}
onFilter={setisFilter}
></PopupHalfScreen>
<View className='subscribe_selection'>
<View
<View
className='subscribe_selection_item'
style={userSelect === 0 ? {color: '#3ba366', fontSize: '1rem', height: '1rem', lineHeight: '1rem'} : {color: 'rgba(0, 0, 0, .3)', fontSize: '.875rem', height: '.875rem', lineHeight: '.875rem'}}
onClick={()=>{setuserSelect(0)}}
>
<Text className='subscribe_selection_item_text'></Text>
</View>
<View
<View
className='subscribe_selection_item'
style={userSelect === 1 ? {color: '#3ba366', fontSize: '1rem', height: '1rem', lineHeight: '1rem'} : {color: 'rgba(0, 0, 0, .3)', fontSize: '.875rem', height: '.875rem', lineHeight: '.875rem'}}
onClick={()=>{setuserSelect(1)}}
onClick={()=>{setuserSelect(1)}}
>
<Text className='subscribe_selection_item_text'></Text>
</View>
@ -534,11 +535,11 @@ export default function Subscribe() {
{/* 列表渲染 */}
{
isGetUsePhone &&
isGetUsePhone &&
<ScrollView
scrollY
scrollWithAnimation
className='subscribe_content'
className={`subscribe_content ${!userSubscribeSingleList.length && !userSubscribeCollectionList.length ? 'empty' : ''}`}
enableFlex
>
<View
@ -547,7 +548,7 @@ export default function Subscribe() {
>
{
userSelect === 0 && userSubscribeSingleList.length > 0 && userSubscribeSingleList.map((item: any, index: number) => (
<View
<View
className='subscribe_content_singleItem'
key={index}
onClick={() => handleToSingleDetail(item.PrdtId)}
@ -561,7 +562,7 @@ export default function Subscribe() {
</View>
)
}
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
@ -575,7 +576,7 @@ export default function Subscribe() {
{
userSelect === 1 && userSubscribeCollectionList.length > 0 && userSubscribeCollectionList.map((item: any, index: number) => (
<View
<View
className='subscribe_content_collectionItem'
key={index}
onClick={() => handleToCollectionDetail(item.PrdtId)}
@ -592,7 +593,7 @@ export default function Subscribe() {
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='aspectFit'
mode='widthFix'
lazyLoad
></Image>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
@ -611,40 +612,41 @@ export default function Subscribe() {
}
</View>
{
isGetUsePhone && (isFilter === '' || isFilter === 'reset') &&
<View className='subscribe_footer'>
<Text className='subscribe_footer_tips'>
{
userSelect === 0 ? `${userSubscribeSingleFreeCount}本免费绘本,${userSubscribeSinglePaidCount}本订阅绘本 ` : `${userSubscribeCollectionFreeCount}套免费绘本,${userSubscribeCollectionPaidCount}套订阅绘本 `
}
</Text>
<Text
className='subscribe_footer_add'
onClick={handleNavigateToMiniProgram}
>
</Text>
</View>
}
</ScrollView>
}
{
isGetUsePhone && userSelect === 0 && userSubscribeSingleList.length === 0 &&
<DefaultPage3></DefaultPage3>
}
{
isGetUsePhone && userSelect === 1 && userSubscribeCollectionList.length === 0 &&
<DefaultPage3></DefaultPage3>
{
isGetUsePhone && (isFilter === '' || isFilter === 'reset') &&
<View className='subscribe_footer'>
<Text className='subscribe_footer_tips'>
{
userSelect === 0 ? `${userSubscribeSingleFreeCount}本免费绘本,${userSubscribeSinglePaidCount}本订阅绘本 ` : `${userSubscribeCollectionFreeCount}套免费绘本,${userSubscribeCollectionPaidCount}套订阅绘本 `
}
</ScrollView>
</Text>
<Text
className='subscribe_footer_add'
onClick={handleNavigateToMiniProgram}
>
</Text>
</View>
}
{
isGetUsePhone && userSelect === 0 && userSubscribeSingleList.length === 0 &&
<DefaultPage3></DefaultPage3>
}
{
isGetUsePhone && userSelect === 1 && userSubscribeCollectionList.length === 0 &&
<DefaultPage3></DefaultPage3>
}
{/* 用户未登录 */}
{
!isGetUsePhone &&
!isGetUsePhone &&
<DefaultPage1
setisGetUsePhone={setisGetUsePhone}
></DefaultPage1>
@ -652,15 +654,15 @@ export default function Subscribe() {
<GetPhoneNumber
onClose={setisGetUsePhone}
scene={userScene}
scene={userScene}
modalVisible={isLoginOpen}
onModalClose={() => setisLoginOpen(false)}
></GetPhoneNumber>
{/* 跳转商城 */}
<GoToStoreModal
visible={isToStoreOpen}
onClose={() => setisToStoreOpen(false)}
<GoToStoreModal
visible={isToStoreOpen}
onClose={() => setisToStoreOpen(false)}
type={1}
setmallLink={(link: string) => {}}
></GoToStoreModal>

@ -11,14 +11,14 @@
height: auto;
display: flex;
background: #fff;
.info_avatar {
width: 6.25rem;
height: 6.25rem;
border-radius: 3.125rem;
padding: 0;
margin: 2rem auto;
.info_avatar_img {
width: 6.25rem;
height: 6.25rem;
@ -53,6 +53,9 @@
height: 1.4375rem;
padding-left: 1.875rem;
}
.phone {
color: #b9b9b9;
}
}
}
@ -72,4 +75,4 @@
margin: auto;
}
}
}
}

@ -52,7 +52,7 @@ export default function UserPersonalInfo() {
}
const handleSave = () => {
console.log('userAvatar=>', userAvatar)
if(isChangeAvatar){
Taro.uploadFile({
@ -77,7 +77,7 @@ export default function UserPersonalInfo() {
})
Taro.setStorageSync('UserAvatar', JSON.parse(res.data).data.user.Avatar)
Taro.setStorageSync('UserNickName', JSON.parse(res.data).data.user.NickName)
setisChangeAvatar(false)
// Taro.navigateBack()
}
@ -101,24 +101,24 @@ export default function UserPersonalInfo() {
duration: 2000
})
Taro.setStorageSync('UserNickName', res.data.data.user.NickName)
setisChangeAvatar(false)
// Taro.navigateBack()0000
}
})
}
}
return (
<View className='info_bg'>
<View className='info_header'>
<Button
openType='chooseAvatar'
className='info_avatar'
<Button
openType='chooseAvatar'
className='info_avatar'
onChooseAvatar={handleChooseAvatar}
>
<Image
<Image
src={userAvatar}
mode='aspectFill'
className='info_avatar_img'
@ -128,8 +128,8 @@ export default function UserPersonalInfo() {
<View className='info_content'>
<View className='info_content_item'>
<Text className='info_content_item_title'></Text>
<Input
className='info_content_item_input'
<Input
className='info_content_item_input'
value={userNickname}
onInput={(e)=>{setuserNickname(e.detail.value)}}
placeholder='name'
@ -137,18 +137,18 @@ export default function UserPersonalInfo() {
</View>
<View className='info_content_item'>
<Text className='info_content_item_title'></Text>
<Input
className='info_content_item_input'
<Input
className='info_content_item_input phone'
value={userPhoneNumber}
disabled
></Input>
</View>
</View>
<View
<View
className='info_content_btn'
onClick={handleSave}
onClick={handleSave}
>
<Text
<Text
className='info_content_btn_text'
></Text>
</View>

@ -65,7 +65,7 @@ export default function UserSubscribe() {
>
{
userSubuscribed && userSubuscribed.length > 0 && userSubuscribed.map((item: any, index: number) => (
<View
<View
className='subscribe_item'
key={index}
onClick={()=>handleToCollectionDetail(item.PrdtId)}
@ -73,17 +73,17 @@ export default function UserSubscribe() {
<View className='item_header'>
<View className='item_header_addtime_icon'></View>
<Text className='item_header_addtime_text'>{item.OrdDate}</Text>
<View
<View
className='item_header_icon'
style={
item.OrdRefer === 2 ? { backgroundColor: '#3BA366' } : { backgroundColor: '#FCCA1E' }
}
}
>
<View
<View
className='item_header_icon_text'
style={
item.OrdRefer === 2 ? { color: '#fff' } : { color: '#000' }
}
}
>
{
item.OrdRefer === 2 ? '兑换' : '购买'
@ -95,29 +95,29 @@ export default function UserSubscribe() {
<View className={'content_container' + 1}>
<View className={'aspect_ratio_flex_container' + 1}>
{
Date.parse(item.PrdtDeadline.split(' ')[0] + 'T' + item.PrdtDeadline.split(' ')[1] + 'Z') < Date.now() &&
Date.parse(item.PrdtDeadline.split(' ')[0] + 'T' + item.PrdtDeadline.split(' ')[1] + 'Z') < Date.now() &&
<View className='shade'>
<View className='shade_context'></View>
</View>
}
<View
<View
className={'item_content_image' + 1}
style={{backgroundImage: `url(${item.PrdtCover})`}}
style={{backgroundImage: `url(${item.PrdtCover})`}}
></View>
</View>
</View>
<View
<View
className='item_content_container'
style={
item.OrdRefer === 0 ? { width: 'calc(100% - 1rem - 7rem)', height: '7rem' } : { width: 'calc(100% - 1rem - 10.75rem)', height: '6.0469rem' }
}
>
<View className='item_content_title'>{item.PrdtTitle}</View>
<View className='item_content_endtime'>{item.PrdtDeadline.slice(0,10)}</View>
<View className='item_content_endtime'>{item.PrdtDeadline.slice(0,10)}</View>
{
Date.parse(item.PrdtDeadline.split(' ')[0] + 'T' + item.PrdtDeadline.split(' ')[1] + 'Z') < Date.now() &&
Date.parse(item.PrdtDeadline.split(' ')[0] + 'T' + item.PrdtDeadline.split(' ')[1] + 'Z') < Date.now() &&
<View className='item_content_btn'>
<View className='item_content_btn_context'>~</View>
</View>
@ -130,7 +130,7 @@ export default function UserSubscribe() {
}
{
userSubuscribed && userSubuscribed.length === 0 &&
userSubuscribed && userSubuscribed.length === 0 &&
<DefaultPage2></DefaultPage2>
}
</ScrollView>

@ -53,7 +53,7 @@ export default function UserHome() {
path: '/pages/Home/index'
}
})
const [userAvator, setuserAvator] = useState('')
const [userNickName, setuserNickName] = useState('')
@ -67,7 +67,7 @@ export default function UserHome() {
//管理登录弹窗
const [isLoginOpen, setisLoginOpen] = useState(false)
const handleGetUserProfile = () => {
if(!Taro.getStorageSync('UserToken')){
setisLoginOpen(true)
@ -76,7 +76,7 @@ export default function UserHome() {
url: '/pages/UserHome/UserPersonalInfo/index'
})
}
// Taro.getUserProfile({
// desc: '用于完善用户资料',
@ -139,7 +139,7 @@ export default function UserHome() {
}
})
}
return (
<View className='user_home_bg'>
<View className='aspect_ratio_flex_container'>
@ -147,8 +147,8 @@ export default function UserHome() {
{/* 内容可以放在这里 */}
<View className='user_home_header_bg'></View>
<View className='use_home_header_info'>
<Image className='user_home_header_info_icon'
src={userAvator === '' ? 'https://oss.jm-kid.com/wx_5colorflower/header.svg' : userAvator}
<Image className='user_home_header_info_icon'
src={userAvator === '' ? 'https://oss.jm-kid.com/wx_5colorflower/header.svg' : userAvator}
onClick={handleGetUserProfile}
></Image>
<Text className='user_home_header_info_name'>{userNickName ? userNickName : '未登录'}</Text>
@ -159,15 +159,15 @@ export default function UserHome() {
<View className='user_home_content'>
{
userOperateList.map((item: any, index: number) => (
index < 2 && <View
key={index}
index < 2 && <View
key={index}
className='user_home_content_item'
onClick={()=>handlePush(item.index ,item.pushUrl)}
>
<Image className='user_home_content_item_icon' src={item.icon}></Image>
<Text className='user_home_content_item_name'>{item.name}</Text>
<Image
className='user_home_content_item_btn'
<Image
className='user_home_content_item_btn'
src='https://oss.jm-kid.com/wx_5colorflower/next.svg'
></Image>
</View>
@ -179,20 +179,20 @@ export default function UserHome() {
>
<Image className='user_home_content_item_icon' src={userOperateList[2].icon}></Image>
<Text className='user_home_content_item_name'>{userOperateList[2].name}</Text>
<Image
className='user_home_content_item_btn'
<Image
className='user_home_content_item_btn'
src='https://oss.jm-kid.com/wx_5colorflower/next.svg'
></Image>
</Button>
<View
<View
className='user_home_content_item'
onClick={()=>handleNavigateToMiniProgram()}
>
<Image className='user_home_content_item_icon' src={userOperateList[3].icon}></Image>
<Text className='user_home_content_item_name'>{userOperateList[3].name}</Text>
<Image
className='user_home_content_item_btn'
<Image
className='user_home_content_item_btn'
src='https://oss.jm-kid.com/wx_5colorflower/next.svg'
></Image>
</View>
@ -200,11 +200,11 @@ export default function UserHome() {
<UserExchangeModal isOpen={isUserExchangeModalOpen} setIsOpen={setisUserExchangeModalOpen}></UserExchangeModal>
<GetPhoneNumber
<GetPhoneNumber
onClose={setisGetUsePhone}
modalVisible={isLoginOpen}
onModalClose={() => setisLoginOpen(false)}
></GetPhoneNumber>
></GetPhoneNumber>
</View>
)
}

Loading…
Cancel
Save