Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
dagouzhi committed Jun 15, 2024
1 parent 6cc8a06 commit 7c73d95
Show file tree
Hide file tree
Showing 14 changed files with 385 additions and 284 deletions.
2 changes: 1 addition & 1 deletion dgz/build/outputs/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "app",
"name": "影视基地",
"appid": "movie_996",
"version": "0.0.42",
"version": "0.0.43",
"appUrlConfig": "https://raw.githubusercontent.com/htyf-mp-community/movie/main/dgz/build/outputs/app.json",
"zipUrl": "https://raw.githubusercontent.com/htyf-mp-community/movie/main/dgz/build/outputs/dist.dgz"
}
Binary file modified dgz/build/outputs/dist.dgz
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "htyf-mp",
"version": "0.0.42",
"version": "0.0.43",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"run:scripts": "node ./scripts/index.js",
Expand Down Expand Up @@ -77,7 +77,7 @@
"@expo/metro-config": "0.18.7",
"@expo/metro-runtime": "~3.1.3",
"@gorhom/bottom-sheet": "4.6.3",
"@htyf-mp/engines": "0.1.11",
"@htyf-mp/engines": "0.1.12",
"@htyf-mp/js-sdk": "0.0.11",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@react-native-async-storage/async-storage": "1.23.1",
Expand Down
68 changes: 34 additions & 34 deletions src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { snakeCase } from 'lodash'
import { routes, entryPath, indexPath } from './routes'
import { snakeCase } from 'lodash';
import { routes, entryPath, indexPath } from './routes';

const mixinConfig: {
pages: string[]
subPackages: { root: string; pages: string[] }[]
entryPagePath: string
pages: string[];
subPackages: { root: string; pages: string[] }[];
entryPagePath: string;
} = {
pages: [],
subPackages: [],
entryPagePath: entryPath.slice(1)
}
pages: [],
subPackages: [],
entryPagePath: entryPath.slice(1),
};

for (const key in routes) {
if (routes.hasOwnProperty(key)) {
if (key === 'pages') {
for (const pageskey in routes.pages) {
const path = routes.pages[pageskey]
if (indexPath === path) mixinConfig.pages.unshift(path.slice(1))
else mixinConfig.pages.push(path.slice(1))
}
} else {
const root = snakeCase(key)
mixinConfig.subPackages.push({
root,
pages: Object.values(routes[key]).map((v: string) => v.replace(`/${root}/`, ''))
})
}
}
if (routes.hasOwnProperty(key)) {
if (key === 'pages') {
for (const pageskey in routes.pages) {
const path = routes.pages[pageskey];
if (indexPath === path) mixinConfig.pages.unshift(path.slice(1));
else mixinConfig.pages.push(path.slice(1));
}
} else {
const root = snakeCase(key);
mixinConfig.subPackages.push({
root,
pages: Object.values(routes[key]).map((v: string) => v.replace(`/${root}/`, '')),
});
}
}
}

export default defineAppConfig({
Expand All @@ -36,32 +36,32 @@ export default defineAppConfig({
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: '',
navigationBarTextStyle: 'black',
backgroundColor: '#F7F9FF'
backgroundColor: '#F7F9FF',
},
tabBar: {
tabBar: {
custom: false,
color: '#757FA1',
selectedColor: '#4172F5',
backgroundColor: '#1b1b1b',
list: [
{
pagePath: routes.pages.index.slice(1),
pagePath: routes.pages.home.slice(1),
selectedIconPath: './assets/tabbar/tabbar_home_on.png',
iconPath: './assets/tabbar/tabbar_home.png',
text: '首页'
text: '首页',
},
{
pagePath: routes.pages.type.slice(1),
selectedIconPath: './assets/tabbar/tabbar_explore_on.png',
iconPath: './assets/tabbar/tabbar_explore.png',
text: '分类'
text: '分类',
},
{
pagePath: routes.pages.setting.slice(1),
selectedIconPath: './assets/tabbar/tabbar_me_on.png',
iconPath: './assets/tabbar/tabbar_me.png',
text: '我的'
}
]
}
})
text: '我的',
},
],
},
});
File renamed without changes.
63 changes: 63 additions & 0 deletions src/pages/home/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import Taro from '@tarojs/taro';
import { View, Text, Image, StandardProps } from '@tarojs/components';
import { useState, useEffect, ReactNode, useMemo } from 'react';
import classnames from 'classnames';
import { navigate, useNavigationBarInfo } from '@/_UIHOOKS_';
import './index.scss';
import searchIcon from '@/assets/search.png';

export interface HeaderProps extends StandardProps {
title?: string;
mode?: boolean;
left?: Function | boolean;
right?: ReactNode | boolean;
backIcon?: 'black' | 'white';
onBack?: () => void;
titleStyle?: StandardProps['style'];
}

export function Header(props: HeaderProps) {
const { navigationContentHeight, statusBarHeight } = useNavigationBarInfo();
return (
<View
{...props}
style={props.style}
className={classnames('pages-index-header-wrap', props.className)}>
<View
style={{
flexShrink: 0,
width: '100%',
height: statusBarHeight || 0,
}}
/>
<View
className={classnames('pages-index-header-body')}
style={
navigationContentHeight
? {
minHeight: navigationContentHeight,
}
: {}
}>
{/* 标题内容容器 */}
<View className={classnames('pages-index-header-body-center')}>
<View
className={classnames('pages-index-header-search-wrap')}
onClick={() => {
navigate.navigateTo({
url: navigate.routes.pages.search,
});
}}>
<Image className="pages-index-header-search-icon" src={searchIcon} />
<Text className={classnames('pages-index-header-search-text')}>
电影名称/明星/导演/年份
</Text>
</View>
</View>
<View className={classnames('pages-index-header-body-right')}></View>
</View>
</View>
);
}

export default Header;
6 changes: 6 additions & 0 deletions src/pages/home/index.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default definePageConfig({
navigationBarTitleText: '首页',
backgroundColor: '#eee',
disableScroll: true,
navigationStyle: 'custom',
});
113 changes: 113 additions & 0 deletions src/pages/home/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
.pages-home-wrap {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
min-width: 100%;
display: flex;
flex-direction: column;
flex: 1;
flex-grow: 2;
background-color: #222222;
}

.pages-home-body-wrap {
flex-grow: 2;
height: 0;
display: flex;
}

.pages-home-scroll-view {
flex-grow: 2;
}

.pages-home-scroll-body {
display: flex;
flex-direction: column;
padding: 0 16px;
}

.pages-home-items-wrap {
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 0 40px 0;
}

.pages-home-item-wrap {
position: relative;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 20px;
justify-content: center;
align-items: center;
width: 318px;
}

.pages-home-item-img-wrap {
position: relative;
width: 286px;
height: 404px;
overflow: hidden;
border-radius: 10px;
background: #eee;
}

.pages-home-item-img {
width: 286px;
height: 404px;
overflow: hidden;
}
.pages-home-item-info-wrap {
margin-bottom: 20px;
}

.pages-home-item-name-wrap {
width: 286px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.pages-home-item-name {
color: #ccc;
font-size: 28px;
font-weight: 700;
}

.pages-home-item-sub-wrap {
width: 286px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.pages-home-item-sub {
color: #999;
font-size: 26px;
}

.pages-home-box-title-wrap {
padding: 30px 0;
}

.pages-home-box-title-text {
color: #999;
font-weight: 700;
font-size: 40px;
}

.pages-home-scroll-y-view {
}

.pages-home-scroll-y-body-wrap {
display: flex;
flex-direction: row;
gap: 20px;
min-height: 404px;
margin-left: 20px;
}
Loading

0 comments on commit 7c73d95

Please sign in to comment.