From 10fc0dd24eb68e6c9a9ec7e6f563c207bf03a248 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Wed, 30 Oct 2024 13:42:44 +0800
Subject: [PATCH] fix
---
src/app.config.ts | 2 +
src/assets/images/empty.svg | 1 -
src/components/gift/index.less | 6 ++
src/components/gift/index.tsx | 16 ++++
src/pages/Customer/index.config.ts | 5 ++
src/pages/Customer/index.less | 7 ++
src/pages/Customer/index.tsx | 14 ++++
src/pages/Home/index.tsx | 3 +
src/pages/Listen/index.tsx | 3 +
src/pages/Share/index.less | 8 +-
src/pages/Share/index.tsx | 2 +-
src/pages/Subscribe/index.tsx | 5 +-
src/pages/UserHome/UserMessage/index.tsx | 2 +-
src/pages/UserHome/UserSubscribe/index.less | 89 ++++++++++++++++++++-
src/pages/UserHome/UserSubscribe/index.tsx | 56 ++++++++++++-
src/pages/UserHome/index.tsx | 5 +-
src/pages/Vip/index.config.ts | 5 ++
src/pages/Vip/index.less | 39 +++++++++
src/pages/Vip/index.tsx | 37 +++++++++
19 files changed, 291 insertions(+), 14 deletions(-)
delete mode 100644 src/assets/images/empty.svg
create mode 100644 src/components/gift/index.less
create mode 100644 src/components/gift/index.tsx
create mode 100644 src/pages/Customer/index.config.ts
create mode 100644 src/pages/Customer/index.less
create mode 100644 src/pages/Customer/index.tsx
create mode 100644 src/pages/Vip/index.config.ts
create mode 100644 src/pages/Vip/index.less
create mode 100644 src/pages/Vip/index.tsx
diff --git a/src/app.config.ts b/src/app.config.ts
index 9013469..51b2fa5 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -21,6 +21,8 @@ export default defineAppConfig({
'pages/ListenSearch/index',
'pages/ListenBookDisplay/index',
'pages/Share/index',
+ 'pages/Customer/index',
+ 'pages/Vip/index',
],
tabBar: {
color: '#999',
diff --git a/src/assets/images/empty.svg b/src/assets/images/empty.svg
deleted file mode 100644
index bb2724c..0000000
--- a/src/assets/images/empty.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/components/gift/index.less b/src/components/gift/index.less
new file mode 100644
index 0000000..11da959
--- /dev/null
+++ b/src/components/gift/index.less
@@ -0,0 +1,6 @@
+.gift_icon {
+ position: fixed;
+ bottom: 5rem;
+ right: 2rem;
+ width: 4rem;
+}
diff --git a/src/components/gift/index.tsx b/src/components/gift/index.tsx
new file mode 100644
index 0000000..15c204f
--- /dev/null
+++ b/src/components/gift/index.tsx
@@ -0,0 +1,16 @@
+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 = () => {
+ Taro.navigateTo({
+ url: '/pages/Customer/index',
+ })
+ }
+
+ return (
+
+ )
+}
diff --git a/src/pages/Customer/index.config.ts b/src/pages/Customer/index.config.ts
new file mode 100644
index 0000000..0a35fd4
--- /dev/null
+++ b/src/pages/Customer/index.config.ts
@@ -0,0 +1,5 @@
+export default {
+ navigationBarTitleText: '添加客服',
+ enableShareAppMessage: true,
+ enableShareTimeline: true,
+}
diff --git a/src/pages/Customer/index.less b/src/pages/Customer/index.less
new file mode 100644
index 0000000..a8801bf
--- /dev/null
+++ b/src/pages/Customer/index.less
@@ -0,0 +1,7 @@
+page {
+ overflow: hidden;
+}
+.pic {
+ width: 100vw;
+ height: 100vh;
+}
diff --git a/src/pages/Customer/index.tsx b/src/pages/Customer/index.tsx
new file mode 100644
index 0000000..d1329b5
--- /dev/null
+++ b/src/pages/Customer/index.tsx
@@ -0,0 +1,14 @@
+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/Home/index.tsx b/src/pages/Home/index.tsx
index 7acdf1b..57d5543 100644
--- a/src/pages/Home/index.tsx
+++ b/src/pages/Home/index.tsx
@@ -5,6 +5,7 @@ import './index.less'
import GetPhoneNumber from '../../components/getPhoneModal'
import GoToStoreModal from '../../components/goToStoreModal'
import UserExchangeSuccessModal from '../../components/UserExchangeSuccessModal'
+import Gift from '../../components/gift'
interface FreeItemProps {
Child: any[],
@@ -399,6 +400,8 @@ export default function Home() {
+
+
diff --git a/src/pages/Listen/index.tsx b/src/pages/Listen/index.tsx
index f1bffe6..5c414ff 100644
--- a/src/pages/Listen/index.tsx
+++ b/src/pages/Listen/index.tsx
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from 'react'
import Taro, { useDidShow } from '@tarojs/taro'
import './index.less'
import GetPhoneNumber from '../../components/getPhoneModal'
+import Gift from '../../components/gift'
// const areaList = [
// {
@@ -304,6 +305,8 @@ export default function Listen() {
}
+
+
{
if (res.from === 'button') {
console.log(res.target);
diff --git a/src/pages/Subscribe/index.tsx b/src/pages/Subscribe/index.tsx
index f4ada81..363837c 100644
--- a/src/pages/Subscribe/index.tsx
+++ b/src/pages/Subscribe/index.tsx
@@ -4,10 +4,9 @@ import { Image, Input, ScrollView, View, Text } from '@tarojs/components'
import PopupHalfScreen from '../../components/Popup'
import DefaultPage1 from '../../components/defaultPage1'
-import DefaultPage2 from '../../components/defaultPage2'
import GetPhoneNumber from '../../components/getPhoneModal'
import GoToStoreModal from '../../components/goToStoreModal'
-import errorIcon from '../../assets/images/error.png'
+import Gift from '../../components/gift'
import './index.less'
import DefaultPage3 from '../../components/defaultPage3'
@@ -662,6 +661,8 @@ export default function Subscribe() {
>
}
+
+
{
if (res.from === 'button') {
diff --git a/src/pages/UserHome/UserSubscribe/index.less b/src/pages/UserHome/UserSubscribe/index.less
index bda34c1..ad118dc 100644
--- a/src/pages/UserHome/UserSubscribe/index.less
+++ b/src/pages/UserHome/UserSubscribe/index.less
@@ -1,7 +1,94 @@
.subscribe_bg {
height: 100vh;
background: #fafafa;
- padding: 0 1rem;
+ padding: 1rem;
+
+ .subscribe_header {
+ width: 100%;
+ height: 2.75rem;
+ display: flex;
+ flex-direction: row;
+ margin-bottom: 1rem;
+
+ .subscribe_header_input {
+ width: calc(100% - 2.5rem - 2rem);
+ height: 2.5rem;
+ background: #f8f8f8;
+ border-radius: 2.25rem;
+ padding-left: 1rem;
+ border: .0625rem solid green;
+ }
+
+ .subscribe_header_dressing {
+ width: 2.5rem;
+ height: 2.5rem;
+ background-image: url(https://oss.jm-kid.com/wx_5colorflower/screenIcon.svg);
+ background-repeat: no-repeat;
+ background-size: cover;
+ margin: auto 0 auto auto;
+ }
+
+ .subscribe_header_scanCodeBtn {
+ position: absolute;
+ top: 1.5625rem;
+ left: 2rem;
+ width: 1.5rem;
+ height: 1.5rem;
+ }
+
+ .subscribe_header_errorIcon {
+ position: absolute;
+ top: 1.5625rem;
+ right: calc(2rem + 3.375rem);
+ width: 1.5rem;
+ height: 1.5rem;
+ z-index: 999;
+ }
+
+ .subscribe_header_searchContainer {
+ position: relative;
+ width: 0;
+ height: 2.5rem;
+ top: calc(2.5rem + .125rem);
+ left: 0;
+
+ .subscribe_searchContainer {
+ position: absolute;
+ left: 1.125rem;
+ width: calc(100vw - 2rem - 3.375rem - 2.25rem);
+ height: auto;
+ background: #fafafa;
+ display: flex;
+ flex-direction: column;
+ z-index: 999;
+ opacity: .9;
+
+ .subscribe_searchItem {
+ // width: 100%;
+ width: auto;
+ height: 2.5rem;
+ background: #fff;
+ border: .0625rem solid #f8f8f8;
+ display: flex;
+ flex-direction: row;
+
+ .subscribe_searchItem_cover {
+ width: 2.5rem;
+ height: 2.5rem;
+ }
+
+ .subscribe_searchItem_title {
+ width: auto;
+ font-size: 1.125rem;
+ font-weight: 600;
+ margin: auto .25rem;
+ }
+ }
+ }
+
+
+ }
+ }
.subscribe_scrollview {
height: 100vh;
diff --git a/src/pages/UserHome/UserSubscribe/index.tsx b/src/pages/UserHome/UserSubscribe/index.tsx
index ddab1f9..18ed755 100644
--- a/src/pages/UserHome/UserSubscribe/index.tsx
+++ b/src/pages/UserHome/UserSubscribe/index.tsx
@@ -1,7 +1,8 @@
-import { ScrollView, View, Text } from '@tarojs/components'
-import React, { useState } from 'react'
+import { ScrollView, View, Text, Input, Image } from '@tarojs/components'
+import React, { useState, useEffect } from 'react'
import Taro, { useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro'
import DefaultPage2 from '../../../components/defaultPage2'
+import PopupHalfScreen from '../../../components/Popup'
import './index.less'
interface subscribeProps {
@@ -35,6 +36,18 @@ export default function UserSubscribe() {
const [userSubuscribed, setuserSubuscribed] = useState()
+ const [timer, setTimer] = useState(null);
+ //搜索框内容
+ const [searchValue, setsearchValue] = useState('')
+
+ //搜索内容
+ const [searchResult, setsearchResult] = useState([])
+
+ const [isPopupOpen, setisPopupOpen] = useState(false)
+
+ //记录用户筛选状态
+ const [isFilter, setisFilter] = useState('')
+
useLoad(() => {
Taro.request({
url: 'https://interapi.jm-kid.com/api/user/subscribed',
@@ -49,6 +62,18 @@ export default function UserSubscribe() {
})
})
+ // 搜索逻辑
+ const handleSearch = () => {
+ // const searchSingle = searchValue ? userSubuscribed.filter(( item:any ) => item.PrdtTitle.includes(searchValue)) : []
+ // console.log('searchSingle=>', searchSingle)
+ // setSearchSingleResults(searchSingle)
+ };
+
+ useEffect(() => {
+ clearTimeout(timer)
+ setTimer(setTimeout(handleSearch, 300))
+ }, [searchValue])
+
//跳转详情页
const handleToCollectionDetail = (id: string) => {
Taro.navigateTo({
@@ -58,6 +83,33 @@ export default function UserSubscribe() {
return (
+
+
+
+ {
+ setsearchValue(e.detail.value)
+ }}
+ >
+ setisPopupOpen(!isPopupOpen)}
+ >
+
+
+ setisPopupOpen(!isPopupOpen)}
+ isfilter={isFilter}
+ onFilter={setisFilter}
+ >
+
+
+
{
+
+ }
+
+
+ useLoad((query)=> {
+ if(Taro.getStorageSync('UserToken')){
+ setuserAvator(Taro.getStorageSync('UserAvatar'))
+ setuserNickName(Taro.getStorageSync('UserNickName'))
+ }
+ })
+
+ return (
+
+
+
+
+ {userNickName}
+ 未开通
+
+ 立即开通
+
+
+ )
+}