From 6544397bd8baa887bb194067fbc20c782a78283c Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Fri, 1 Nov 2024 16:09:32 +0800
Subject: [PATCH] fix
---
src/assets/images/service.svg | 34 -
src/assets/images/share.svg | 21617 -------------------------------
src/assets/images/store.png | Bin 4767 -> 0 bytes
src/components/gift/index.tsx | 3 +-
src/pages/Customer/index.tsx | 3 +-
src/pages/Share/index.less | 9 +-
src/pages/Share/index.tsx | 52 +-
src/pages/Subscribe/index.less | 73 +-
src/pages/Subscribe/index.tsx | 102 +-
src/pages/UserHome/index.tsx | 10 +-
src/pages/Vip/index.less | 2 +-
src/pages/Vip/index.tsx | 89 +-
12 files changed, 181 insertions(+), 21813 deletions(-)
delete mode 100644 src/assets/images/service.svg
delete mode 100644 src/assets/images/share.svg
delete mode 100644 src/assets/images/store.png
diff --git a/src/assets/images/service.svg b/src/assets/images/service.svg
deleted file mode 100644
index 594a7c7..0000000
--- a/src/assets/images/service.svg
+++ /dev/null
@@ -1,34 +0,0 @@
-
diff --git a/src/assets/images/share.svg b/src/assets/images/share.svg
deleted file mode 100644
index 98280cd..0000000
--- a/src/assets/images/share.svg
+++ /dev/null
@@ -1,21617 +0,0 @@
-
-
-
diff --git a/src/assets/images/store.png b/src/assets/images/store.png
deleted file mode 100644
index ef5124ba00bfec82a8c0c5ac977da302aa847d65..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4767
zcmV;Q5@79#P)-*N)dxUuZc>nl`9CZGh>V>VJa3pTy*Vc*WqYt0hC;p!tt3U=X
zZ246(A_?ZIePX>#N|K+D&d%!{r~cuxujT~p61(V`-OtDa{)0(*$MyWY&A&UkIODGV
zmqojO|9&Ih<6{*_`TeaAYis_9cAPrrV|sBzqcXum!HyH3f2WH$;fQwaraP`bM01nd
z=-N#==VCb{0&*`8to-uROWm&paY9*E
z1W#XmEZM&AzA6)o*`b~L3-MzdtBknsZN0rDw>EJ0n+&L&(mSQ0zW&JD>VyD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E6lvSJ`xKEz$2MM
zeNB*_&=DuTMnxJlh6LOfZ146j
zRyCl5n1SaeLy-&ttuVnLIMb$sjE|651{34$`nz=H95_;M1-YXi}2DZy?&wuEvT8J3f%S@FRG1h2KzH_J&3k*tV&
z)uB8XJm$})Vp^m`=P!zX0zfVR#SEGCfv`#78Ce#qn*-Rl@vL+KqP+@Y=uSg0zS$Xa
z9c)aEZ0TfTGq&n46To{4 {
@@ -11,6 +10,6 @@ export default function Gift() {
}
return (
-
+
)
}
diff --git a/src/pages/Customer/index.tsx b/src/pages/Customer/index.tsx
index d1329b5..e51049d 100644
--- a/src/pages/Customer/index.tsx
+++ b/src/pages/Customer/index.tsx
@@ -1,12 +1,11 @@
import { Image } from '@tarojs/components'
import './index.less'
-import customerPic from '../../assets/images/customer.svg'
export default function Customer() {
return (
diff --git a/src/pages/Share/index.less b/src/pages/Share/index.less
index a8801bf..1c68664 100644
--- a/src/pages/Share/index.less
+++ b/src/pages/Share/index.less
@@ -1,7 +1,10 @@
page {
overflow: hidden;
}
-.pic {
- width: 100vw;
- height: 100vh;
+.share_btn {
+ padding: 0;
+ .pic {
+ width: 100vw;
+ height: 100vh;
+ }
}
diff --git a/src/pages/Share/index.tsx b/src/pages/Share/index.tsx
index cbd7425..bcda7ea 100644
--- a/src/pages/Share/index.tsx
+++ b/src/pages/Share/index.tsx
@@ -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 (
- //
-
+
)
}
diff --git a/src/pages/Subscribe/index.less b/src/pages/Subscribe/index.less
index fa4f8d2..9859eeb 100644
--- a/src/pages/Subscribe/index.less
+++ b/src/pages/Subscribe/index.less
@@ -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 {
diff --git a/src/pages/Subscribe/index.tsx b/src/pages/Subscribe/index.tsx
index 363837c..0093c80 100644
--- a/src/pages/Subscribe/index.tsx
+++ b/src/pages/Subscribe/index.tsx
@@ -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() {
handleToSingleDetail(item.PrdtId)}
+ onClick={() => handleToSingleDetail(item)}
>
- {
- item.isFree === 1 && (
-
-
- 免费绘本
-
-
- )
- }
-
{
- !item.isFree1 && (
+ item.SubscribedState === -1 && (
已 过 期
)
}
+ {
+ item.isFree === 1 && 免费绘本
+ }
+ {
+ item.OrdRefer === 3 && 免费赠送
+ }
+
{item.PrdtTitle}
))
@@ -590,21 +623,20 @@ export default function Subscribe() {
key={index}
onClick={() => handleToCollectionDetail(item.PrdtId)}
>
- {
- item.isFree === 1 && (
-
-
- 免费绘本
-
-
- )
- }
-
+
+
+ {
+ item.isFree === 1 && 免费绘本
+ }
+ {
+ item.OrdRefer === 3 && 免费赠送
+ }
+
{item.PrdtTitle}
{`共${item.ChildCount}本`}
diff --git a/src/pages/UserHome/index.tsx b/src/pages/UserHome/index.tsx
index c9fa6be..665507c 100644
--- a/src/pages/UserHome/index.tsx
+++ b/src/pages/UserHome/index.tsx
@@ -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,
},
diff --git a/src/pages/Vip/index.less b/src/pages/Vip/index.less
index b5ca028..684fd47 100644
--- a/src/pages/Vip/index.less
+++ b/src/pages/Vip/index.less
@@ -20,7 +20,7 @@
.vip_list_info {
display: flex;
justify-content: space-between;
- margin-bottom: .3rem;
+ margin-bottom: .5rem;
font-size: .95rem;
color: #714135;
}
diff --git a/src/pages/Vip/index.tsx b/src/pages/Vip/index.tsx
index a312c84..a6f4af1 100644
--- a/src/pages/Vip/index.tsx
+++ b/src/pages/Vip/index.tsx
@@ -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()
+
+ // 开通记录
+ const [records, setRecords] = useState()
+
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() {
>
{userNickName}
- 未开通
+ {info?.SubscribedState ? info?.PrdtDeadline.split(' ')[0] + '日到期' : '未开通'}
- 立即开通
+ 立即{info?.SubscribedState ? '续费' : '开通'}
- 暂无开通记录~
-
-
- 开通记录
-
-
-
-
- 熏听会员年卡
- 1年
-
-
- 开通时间:2024
- 到期时间:2024
-
+
+ {
+ records && records.length ?
+ (
+ 开通记录
+
+
+ {
+ records.map((item: any, index: number) => (
+
+
+ {item.Title}
+ 1年
+
+
+ 开通时间:{item.CreateTime.split(' ')[0]}
+ 到期时间:{item.PrdtDeadline.split(' ')[0]}
+
+
+ ))
+ }
-
-
+ ) :
+ 暂无开通记录~
+ }
)
}