yujialong 3 weeks ago
parent 27eef168b3
commit 6544397bd8
  1. 34
      src/assets/images/service.svg
  2. 21617
      src/assets/images/share.svg
  3. BIN
      src/assets/images/store.png
  4. 3
      src/components/gift/index.tsx
  5. 3
      src/pages/Customer/index.tsx
  6. 9
      src/pages/Share/index.less
  7. 52
      src/pages/Share/index.tsx
  8. 73
      src/pages/Subscribe/index.less
  9. 102
      src/pages/Subscribe/index.tsx
  10. 10
      src/pages/UserHome/index.tsx
  11. 2
      src/pages/Vip/index.less
  12. 89
      src/pages/Vip/index.tsx

@ -1,34 +0,0 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<ellipse opacity="0.1" cx="27" cy="28.5" rx="23" ry="18.5" fill="url(#paint0_linear_1339_10715)"/>
<ellipse cx="22" cy="22.5" rx="22" ry="18.5" fill="url(#paint1_linear_1339_10715)"/>
<circle cx="10.5" cy="30.5" r="1.5" fill="#3BA366"/>
<circle cx="5" cy="6" r="2.5" stroke="#FCCA1E" stroke-opacity="0.6"/>
<circle cx="46" cy="12" r="2" stroke="#3BA366" stroke-width="2"/>
<g clip-path="url(#clip0_1339_10715)">
<path d="M25 24C23.1435 24 21.363 23.2625 20.0503 21.9497C18.7375 20.637 18 18.8565 18 17C18 15.1435 18.7375 13.363 20.0503 12.0503C21.363 10.7375 23.1435 10 25 10C26.8565 10 28.637 10.7375 29.9497 12.0503C31.2625 13.363 32 15.1435 32 17C32 18.8565 31.2625 20.637 29.9497 21.9497C28.637 23.2625 26.8565 24 25 24ZM25 21C27.21 21 29 19.328 29 18.5C29 17.672 27.21 19 25 19C22.79 19 21 17.672 21 18.5C21 19.328 22.79 21 25 21Z" fill="#3BA366"/>
<path d="M25 24C23.1435 24 21.363 23.2625 20.0503 21.9497C18.7375 20.637 18 18.8565 18 17C18 15.1435 18.7375 13.363 20.0503 12.0503C21.363 10.7375 23.1435 10 25 10C26.8565 10 28.637 10.7375 29.9497 12.0503C31.2625 13.363 32 15.1435 32 17C32 18.8565 31.2625 20.637 29.9497 21.9497C28.637 23.2625 26.8565 24 25 24ZM25 21C27.21 21 29 19.328 29 18.5C29 17.672 27.21 19 25 19C22.79 19 21 17.672 21 18.5C21 19.328 22.79 21 25 21Z" fill="url(#paint2_linear_1339_10715)"/>
<path d="M29.8879 26.069C29.757 26.3881 29.5201 26.6523 29.2172 26.8172C28.9143 26.982 28.5638 27.0375 28.2248 26.9742C27.8858 26.9109 27.5789 26.7327 27.3559 26.4696C27.1329 26.2065 27.0074 25.8746 27.0004 25.5298C26.9935 25.185 27.1056 24.8483 27.3179 24.5765C27.5301 24.3047 27.8296 24.1143 28.1658 24.0374C28.502 23.9605 28.8544 24.0018 29.1637 24.1544C29.473 24.307 29.7203 24.5614 29.8639 24.875C32.1039 23.219 33.4999 20.491 33.4999 17.495C33.4999 12.523 29.6879 8.5 24.9999 8.5C20.3119 8.5 16.4999 12.522 16.4999 17.496C16.4997 18.5261 16.6665 19.5494 16.9939 20.526C17.0171 20.5887 17.0274 20.6554 17.0244 20.7222C17.0213 20.789 17.0049 20.8544 16.9761 20.9148C16.9473 20.9751 16.9067 21.029 16.8567 21.0734C16.8067 21.1177 16.7483 21.1516 16.685 21.173C16.6216 21.1944 16.5547 21.2029 16.488 21.198C16.4213 21.193 16.3563 21.1748 16.2968 21.1443C16.2374 21.1138 16.1846 21.0717 16.1417 21.0205C16.0987 20.9692 16.0665 20.9099 16.0469 20.846C15.9516 20.5644 15.8685 20.2788 15.7979 19.99C15.3217 19.9422 14.8785 19.7252 14.5487 19.3784C14.2188 19.0316 14.0243 18.5781 14.0003 18.1001C13.9764 17.6222 14.1246 17.1515 14.4181 16.7735C14.7116 16.3954 15.1309 16.1352 15.5999 16.04C16.2699 11.214 20.2179 7.5 24.9999 7.5C29.7819 7.5 33.7299 11.214 34.3999 16.04C34.8689 16.1354 35.2882 16.3958 35.5816 16.774C35.8749 17.1522 36.023 17.623 35.9988 18.101C35.9746 18.579 35.7797 19.0325 35.4497 19.3791C35.1196 19.7257 34.6762 19.9425 34.1999 19.99C33.5819 22.524 32.0349 24.712 29.8879 26.069Z" fill="#3BA366"/>
<path d="M29.8879 26.069C29.757 26.3881 29.5201 26.6523 29.2172 26.8172C28.9143 26.982 28.5638 27.0375 28.2248 26.9742C27.8858 26.9109 27.5789 26.7327 27.3559 26.4696C27.1329 26.2065 27.0074 25.8746 27.0004 25.5298C26.9935 25.185 27.1056 24.8483 27.3179 24.5765C27.5301 24.3047 27.8296 24.1143 28.1658 24.0374C28.502 23.9605 28.8544 24.0018 29.1637 24.1544C29.473 24.307 29.7203 24.5614 29.8639 24.875C32.1039 23.219 33.4999 20.491 33.4999 17.495C33.4999 12.523 29.6879 8.5 24.9999 8.5C20.3119 8.5 16.4999 12.522 16.4999 17.496C16.4997 18.5261 16.6665 19.5494 16.9939 20.526C17.0171 20.5887 17.0274 20.6554 17.0244 20.7222C17.0213 20.789 17.0049 20.8544 16.9761 20.9148C16.9473 20.9751 16.9067 21.029 16.8567 21.0734C16.8067 21.1177 16.7483 21.1516 16.685 21.173C16.6216 21.1944 16.5547 21.2029 16.488 21.198C16.4213 21.193 16.3563 21.1748 16.2968 21.1443C16.2374 21.1138 16.1846 21.0717 16.1417 21.0205C16.0987 20.9692 16.0665 20.9099 16.0469 20.846C15.9516 20.5644 15.8685 20.2788 15.7979 19.99C15.3217 19.9422 14.8785 19.7252 14.5487 19.3784C14.2188 19.0316 14.0243 18.5781 14.0003 18.1001C13.9764 17.6222 14.1246 17.1515 14.4181 16.7735C14.7116 16.3954 15.1309 16.1352 15.5999 16.04C16.2699 11.214 20.2179 7.5 24.9999 7.5C29.7819 7.5 33.7299 11.214 34.3999 16.04C34.8689 16.1354 35.2882 16.3958 35.5816 16.774C35.8749 17.1522 36.023 17.623 35.9988 18.101C35.9746 18.579 35.7797 19.0325 35.4497 19.3791C35.1196 19.7257 34.6762 19.9425 34.1999 19.99C33.5819 22.524 32.0349 24.712 29.8879 26.069Z" fill="url(#paint3_linear_1339_10715)"/>
</g>
<defs>
<linearGradient id="paint0_linear_1339_10715" x1="11.5" y1="14" x2="42" y2="42.5" gradientUnits="userSpaceOnUse">
<stop stop-color="#FCCA1E" stop-opacity="0"/>
<stop offset="1" stop-color="#FCCA1E"/>
</linearGradient>
<linearGradient id="paint1_linear_1339_10715" x1="13.5" y1="8" x2="33" y2="37" gradientUnits="userSpaceOnUse">
<stop stop-color="#329C5E" stop-opacity="0"/>
<stop offset="1" stop-color="#3BA366" stop-opacity="0.3"/>
</linearGradient>
<linearGradient id="paint2_linear_1339_10715" x1="25.0003" y1="16.8206" x2="32.4406" y2="10.541" gradientUnits="userSpaceOnUse">
<stop stop-color="#FCCA1E" stop-opacity="0"/>
<stop offset="1" stop-color="#FCCA1E"/>
</linearGradient>
<linearGradient id="paint3_linear_1339_10715" x1="25" y1="17" x2="35.5" y2="7" gradientUnits="userSpaceOnUse">
<stop stop-color="#FCCA1E" stop-opacity="0"/>
<stop offset="1" stop-color="#FCCA1E"/>
</linearGradient>
<clipPath id="clip0_1339_10715">
<rect width="24" height="24" fill="white" transform="translate(13 5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 5.4 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

@ -1,7 +1,6 @@
import { Image } from '@tarojs/components'
import Taro from '@tarojs/taro';
import './index.less'
import giftIcon from '../../assets/images/gift.svg'
export default function Gift() {
const toCustomer = () => {
@ -11,6 +10,6 @@ export default function Gift() {
}
return (
<Image src={giftIcon} mode='widthFix' className='gift_icon' onClick={toCustomer}></Image>
<Image src='https://oss.jm-kid.com/wx_5colorflower/icons/gift.svg' mode='widthFix' className='gift_icon' onClick={toCustomer}></Image>
)
}

@ -1,12 +1,11 @@
import { Image } from '@tarojs/components'
import './index.less'
import customerPic from '../../assets/images/customer.svg'
export default function Customer() {
return (
<Image
src={customerPic}
src='https://oss.jm-kid.com/wx_5colorflower/icons/customer.svg'
className='pic'
mode='aspectFill'
></Image>

@ -1,7 +1,10 @@
page {
overflow: hidden;
}
.pic {
width: 100vw;
height: 100vh;
.share_btn {
padding: 0;
.pic {
width: 100vw;
height: 100vh;
}
}

@ -1,8 +1,6 @@
import { View, Image } from '@tarojs/components'
import Taro, { useLoad, useShareAppMessage, useShareTimeline, updateShareMenu, showShareMenu } from '@tarojs/taro'
import React, { useState } from 'react'
import { Image, Button } from '@tarojs/components'
import Taro, { useShareAppMessage, useShareTimeline } from '@tarojs/taro'
import './index.less'
import sharePic from '../../assets/images/share.svg'
export default function Share() {
const inviteCode = Taro.getStorageSync('UserInviteCode') // 邀请码
@ -24,45 +22,13 @@ export default function Share() {
}
})
const handleShare = () => {
// updateShareMenu({
// success: () => {
// // 更新成功
// },
// fail: err => {
// // 更新失败
// console.error('Failed to update share menu:', err);
// }
// });
// return {
// title: '这是一个测试分享标题',
// path: '/pages/index/index',
// imageUrl: 'https://example.com/path/to/image.png'
// };
showShareMenu({
withShareTicket: true
})
};
const [prdtId, setprdtId] = useState(-1)
const [resId, setresId] = useState(-1)
useLoad((query)=> {
// console.log(query.prdtId, query.resId)
// setprdtId(query.prdtId)
// setresId(query.resId)
})
return (
// <View className='pic'></View>
<Image
src={sharePic}
className='pic'
mode='aspectFill'
onClick={handleShare}
></Image>
<Button openType='share' className='share_btn'>
<Image
src='https://oss.jm-kid.com/wx_5colorflower/icons/share.svg'
className='pic'
mode='aspectFill'
></Image>
</Button>
)
}

@ -125,7 +125,6 @@
.subscribe_container {
display: grid;
grid-template-columns: repeat(3, 1fr);
// height: auto;
gap: .8rem .625rem;
.subscribe_content_singleItem {
@ -133,35 +132,22 @@
height: calc((100vw - 2rem - 1.25rem) / 3 + .5rem + 2.5rem);
display: flex;
flex-direction: column;
.relative_container {
position: relative;
width: 100%;
height: 0;
top: 0;
left: 0;
.subscribe_content_singleItem_label {
position: absolute;
left: calc(100% - 3rem);
top: calc((100vw - 2rem - 1.25rem) / 3 - 1rem);
width: 3rem;
height: 1rem;
border-radius: .75rem 0;
background-color: #fcca1e;
display: flex;
.subscribe_content_singleItem_label_text {
font-size: .5rem;
margin: auto;
}
}
}
.cover_wrap {
position: relative;
border-radius: .75rem;
overflow: hidden;
}
.subscribe_content_singleItem_label {
position: absolute;
right: 0;
bottom: 0;
width: 3rem;
font-size: .5rem;
text-align: center;
line-height: 1rem;
border-radius: .75rem 0;
background-color: #fcca1e;
}
.expire {
position: absolute;
@ -188,6 +174,7 @@
.subscribe_content_singleItem_cover {
width: 100%;
border-radius: .75rem;
}
.subscribe_content_singleItem_title {
@ -203,29 +190,22 @@
width: 100%;
display: flex;
flex-direction: column;
.relative_container {
.cover_wrap {
position: relative;
width: 100%;
height: 0;
top: 0;
left: 0;
.subscribe_content_singleItem_label {
position: absolute;
left: calc(100% - 3rem);
top: calc(((100vw - 2rem - .625rem) / 2) * .5625 - 1rem);
width: 3rem;
height: 1rem;
border-radius: .75rem 0;
background-color: #fcca1e;
display: flex;
border-radius: .75rem;
overflow: hidden;
}
.subscribe_content_singleItem_label_text {
font-size: .5rem;
margin: auto;
}
}
.subscribe_content_singleItem_label {
position: absolute;
right: 0;
bottom: 0;
width: 3rem;
font-size: .5rem;
text-align: center;
line-height: 1rem;
border-radius: .75rem 0;
background-color: #fcca1e;
}
.subscribe_content_singleItem_cover {
@ -234,7 +214,6 @@
max-height: 5.8rem;
min-height: 5.8rem;
border-radius: .75rem;
margin-bottom: .625rem;
}
.subscribe_content_singleItem_title {

@ -422,16 +422,52 @@ export default function Subscribe() {
}
//跳转详情页
const handleToCollectionDetail = (id: string) => {
Taro.navigateTo({
url: '/pages/CollectionDetail/index?id=' + id
})
const handleToCollectionDetail = (item: any) => {
if (item.SubscribedState === -1) {
// 已过期,直接删除
Taro.request({
url: 'https://interapi.jm-kid.com/api/mark/subscribed',
method: 'POST',
header: {
authorization: `bearer ${Taro.getStorageSync('UserToken')}`
},
data: {
timestamp: Date.now(),
prdt_id: item.PrdtId
},
success: () => {
requestUserSubscribe()
},
})
} else {
Taro.navigateTo({
url: '/pages/CollectionDetail/index?id=' + item.PrdtId
})
}
}
const handleToSingleDetail = (id: string) => {
Taro.navigateTo({
url: '/pages/SingleDetail/index?id=' + id
})
const handleToSingleDetail = (item: any) => {
if (item.SubscribedState === -1) {
// 已过期,直接删除
Taro.request({
url: 'https://interapi.jm-kid.com/api/mark/subscribed',
method: 'POST',
header: {
authorization: `bearer ${Taro.getStorageSync('UserToken')}`
},
data: {
timestamp: Date.now(),
prdt_id: item.ParentPrdtId
},
success: () => {
requestUserSubscribe()
},
})
} else {
Taro.navigateTo({
url: '/pages/SingleDetail/index?id=' + item.PrdtId
})
}
}
const handleNavigateToMiniProgram = () => {
@ -550,18 +586,8 @@ export default function Subscribe() {
<View
className='subscribe_content_singleItem'
key={index}
onClick={() => handleToSingleDetail(item.PrdtId)}
onClick={() => handleToSingleDetail(item)}
>
{
item.isFree === 1 && (
<View className='relative_container'>
<View className='subscribe_content_singleItem_label'>
<Text className='subscribe_content_singleItem_label_text'></Text>
</View>
</View>
)
}
<View className='cover_wrap'>
<Image
className='subscribe_content_singleItem_cover'
@ -570,14 +596,21 @@ export default function Subscribe() {
lazyLoad
></Image>
{
!item.isFree1 && (
item.SubscribedState === -1 && (
<View className='expire'>
<Image src='https://oss.jm-kid.com/wx_5colorflower/error.png' className='expire_icon'></Image>
<View className='expire_text'> </View>
</View>
)
}
{
item.isFree === 1 && <Text className='subscribe_content_singleItem_label'></Text>
}
{
item.OrdRefer === 3 && <Text className='subscribe_content_singleItem_label'></Text>
}
</View>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
</View>
))
@ -590,21 +623,20 @@ export default function Subscribe() {
key={index}
onClick={() => handleToCollectionDetail(item.PrdtId)}
>
{
item.isFree === 1 && (
<View className='relative_container'>
<View className='subscribe_content_singleItem_label'>
<Text className='subscribe_content_singleItem_label_text'></Text>
</View>
</View>
)
}
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='widthFix'
lazyLoad
></Image>
<View className='cover_wrap'>
<Image
className='subscribe_content_singleItem_cover'
src={item.PrdtCover}
mode='widthFix'
lazyLoad
></Image>
{
item.isFree === 1 && <Text className='subscribe_content_singleItem_label'></Text>
}
{
item.OrdRefer === 3 && <Text className='subscribe_content_singleItem_label'></Text>
}
</View>
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View>
<View className='subscribe_content_collectionItem_count'>{`${item.ChildCount}`}</View>
</View>

@ -18,7 +18,7 @@ const userOperateList = [
},
{
name: '熏听会员',
icon: 'https://oss.jm-kid.com/wx_5colorflower/operate2.svg',
icon: 'https://oss.jm-kid.com/wx_5colorflower/icons/operate5.svg',
pushUrl: '/pages/Vip/index',
des: '未开通',
},
@ -29,23 +29,23 @@ const userOperateList = [
},
{
name: '商城',
icon: storeIcon,
icon: 'https://oss.jm-kid.com/wx_5colorflower/icons/operate4.svg',
pushUrl: '',
},
{
name: '邀请好友',
icon: storeIcon,
icon: 'https://oss.jm-kid.com/wx_5colorflower/icons/operate7.svg',
pushUrl: '/pages/Share/index',
des: '免费领绘本',
},
{
name: '联系客服',
icon: serviceIcon,
icon: 'https://oss.jm-kid.com/wx_5colorflower/icons/operate8.svg',
pushUrl: '/pages/Customer/index',
},
{
name: '消息',
icon: storeIcon,
icon: 'https://oss.jm-kid.com/wx_5colorflower/icons/operate6.svg',
pushUrl: '/pages/UserHome/UserMessage/index',
des: 10,
},

@ -20,7 +20,7 @@
.vip_list_info {
display: flex;
justify-content: space-between;
margin-bottom: .3rem;
margin-bottom: .5rem;
font-size: .95rem;
color: #714135;
}

@ -3,21 +3,55 @@ import Taro, { useLoad } from '@tarojs/taro'
import React, { useState } from 'react'
import './index.less'
interface RecordProps {
CreateTime: string,
PrdtDeadline: string,
Title: string,
SubscribedState?: number,
}
export default function Share() {
const [userAvator, setuserAvator] = useState('')
const [userNickName, setuserNickName] = useState('')
// 会员信息
const [info, setInfo] = useState<RecordProps>()
// 开通记录
const [records, setRecords] = useState<RecordProps[]>()
const handleShare = () => {
}
useLoad((query)=> {
if(Taro.getStorageSync('UserToken')){
setuserAvator(Taro.getStorageSync('UserAvatar'))
setuserNickName(Taro.getStorageSync('UserNickName'))
}
useLoad(()=> {
setuserAvator(Taro.getStorageSync('UserAvatar'))
setuserNickName(Taro.getStorageSync('UserNickName'))
Taro.request({
url: 'https://interapi.jm-kid.com/api/member/data',
method: 'POST',
header: {
authorization: `bearer ${Taro.getStorageSync('UserToken')}`
},
data: {
timestamp: Date.now(),
member_type: 'audio'
},
success: (res: any) => {
if(res.data.state === 200){
const { list, main } = res.data.data
console.log(11, list,records)
setRecords(list)
main && setInfo(main)
}
},
fail: (err: any) => {
console.log('兑换失败=>', err)
}
})
})
return (
@ -28,28 +62,35 @@ export default function Share() {
></Image>
<View className='vip_info'>
<View className='vip_name'>{userNickName}</View>
<View className='vip_status'></View>
<View className='vip_status'>{info?.SubscribedState ? info?.PrdtDeadline.split(' ')[0] + '日到期' : '未开通'}</View>
</View>
<View className='vip_open'></View>
<View className='vip_open'>{info?.SubscribedState ? '续费' : '开通'}</View>
</View>
<View className='vip_none'>~</View>
<View className='vip_record'>
<Text className='vip_title'></Text>
<View className='vip_list'>
<View className='vip_list_item'>
<View className='vip_list_info'>
<Text></Text>
<Text>1</Text>
</View>
<View className='vip_list_date'>
<Text>2024</Text>
<Text>2024</Text>
</View>
{
records && records.length ?
(<View className='vip_record'>
<Text className='vip_title'></Text>
<View className='vip_list'>
{
records.map((item: any, index: number) => (
<View className='vip_list_item' key={index}>
<View className='vip_list_info'>
<Text>{item.Title}</Text>
<Text>1</Text>
</View>
<View className='vip_list_date'>
<Text>{item.CreateTime.split(' ')[0]}</Text>
<Text>{item.PrdtDeadline.split(' ')[0]}</Text>
</View>
</View>
))
}
</View>
</View>
</View>
</View>) :
<View className='vip_none'>~</View>
}
</View>
)
}

Loading…
Cancel
Save