feat(coupon): 添加优惠券领取中心功能

- 新增优惠券领取中心页面,包含热门优惠券轮播、优惠券列表、筛选功能等
- 实现优惠券数据加载、搜索、下拉刷新、加载更多等功能
- 添加优惠券领取逻辑,支持用户领取优惠券
- 优化邀请小程序码生成和分享功能
-调整首页和用户订单组件的样式
This commit is contained in:
2025-08-22 11:46:12 +08:00
parent 40e282cf8f
commit 46761bdacd
14 changed files with 695 additions and 162 deletions

View File

@@ -7,8 +7,9 @@ import {getUserInfo, getWxOpenId} from "@/api/layout";
import {TenantId} from "@/config/app";
import {getOrganization} from "@/api/system/organization";
import {myUserVerify} from "@/api/system/userVerify";
import { useShopInfo } from '@/hooks/useShopInfo';
import {useShopInfo} from '@/hooks/useShopInfo';
import {handleInviteRelation} from "@/utils/invite";
import {View, Text} from '@tarojs/components'
import MySearch from "./MySearch";
import './Header.scss';
@@ -85,7 +86,7 @@ const Header = (props: any) => {
}
/* 获取用户手机号 */
const handleGetPhoneNumber = ({detail}: {detail: {code?: string, encryptedData?: string, iv?: string}}) => {
const handleGetPhoneNumber = ({detail}: { detail: { code?: string, encryptedData?: string, iv?: string } }) => {
const {code, encryptedData, iv} = detail
Taro.login({
success: function () {
@@ -155,39 +156,39 @@ const Header = (props: any) => {
return (
<>
<div className={'fixed top-0 header-bg'} style={{
<View className={'fixed top-0 header-bg'} style={{
height: !props.stickyStatus ? '180px' : '148px',
}}>
<MySearch/>
{/*{!props.stickyStatus && <MySearch done={reload}/>}*/}
</div>
</View>
<NavBar
style={{marginTop: `${statusBarHeight}px`, marginBottom: '0px', backgroundColor: 'transparent'}}
onBackClick={() => {
}}
left={
!IsLogin ? (
<div style={{display: 'flex', alignItems: 'center'}}>
<Button style={{color: '#000'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
<Space style={{display: 'flex', alignItems: 'center'}}>
<Button style={{color: '#ffffff'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
<Space>
<Avatar
size="22"
src={getWebsiteLogo()}
/>
<span style={{color: '#000'}}>{getWebsiteName()}</span>
<Text style={{color: '#ffffff'}}>{getWebsiteName()}</Text>
</Space>
</Button>
<TriangleDown size={9}/>
</div>
<TriangleDown size={9} className={'text-white'}/>
</Space>
) : (
<div style={{display: 'flex', alignItems: 'center', gap: '8px'}}>
<View style={{display: 'flex', alignItems: 'center', gap: '8px'}}>
<Avatar
size="22"
src={getWebsiteLogo()}
/>
<span className={'text-white'}>{getWebsiteName()}</span>
<Text className={'text-white'}>{getWebsiteName()}</Text>
<TriangleDown className={'text-white'} size={9}/>
</div>
</View>
)}>
</NavBar>
</>