forked from gxwebsoft/mp-10550
feat(coupon): 添加优惠券领取中心功能
- 新增优惠券领取中心页面,包含热门优惠券轮播、优惠券列表、筛选功能等 - 实现优惠券数据加载、搜索、下拉刷新、加载更多等功能 - 添加优惠券领取逻辑,支持用户领取优惠券 - 优化邀请小程序码生成和分享功能 -调整首页和用户订单组件的样式
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
|
||||
@@ -39,7 +39,7 @@ function UserOrder() {
|
||||
<View className={'flex justify-around pb-1 mt-4'}>
|
||||
{/* 待付款 */}
|
||||
{orderStats.pending > 0 ? (
|
||||
<Badge value={orderStats.pending} max={99}>
|
||||
<Badge value={orderStats.pending} max={99} fill={'outline'}>
|
||||
<View className={'item flex justify-center flex-col items-center'}>
|
||||
<Wallet size={26} className={'font-normal text-gray-500'}
|
||||
onClick={() => navTo('/user/order/order?statusFilter=0', true)}/>
|
||||
@@ -56,7 +56,7 @@ function UserOrder() {
|
||||
|
||||
{/* 待发货 */}
|
||||
{orderStats.paid > 0 ? (
|
||||
<Badge value={orderStats.paid} max={99}>
|
||||
<Badge value={orderStats.paid} max={99} fill={'outline'}>
|
||||
<View className={'item flex justify-center flex-col items-center'}
|
||||
onClick={() => navTo('/user/order/order?statusFilter=1', true)}>
|
||||
<Package size={26} className={'text-gray-500 font-normal'}/>
|
||||
@@ -73,7 +73,7 @@ function UserOrder() {
|
||||
|
||||
{/* 待收货 */}
|
||||
{orderStats.shipped > 0 ? (
|
||||
<Badge value={orderStats.shipped} max={99}>
|
||||
<Badge value={orderStats.shipped} max={99} fill={'outline'}>
|
||||
<View className={'item flex justify-center flex-col items-center'}
|
||||
onClick={() => navTo('/user/order/order?statusFilter=3', true)}>
|
||||
<Transit size={24} className={'text-gray-500 font-normal'}/>
|
||||
@@ -97,7 +97,7 @@ function UserOrder() {
|
||||
|
||||
{/* 退货/售后 */}
|
||||
{orderStats.refund > 0 ? (
|
||||
<Badge value={orderStats.refund} max={99}>
|
||||
<Badge value={orderStats.refund} max={99} fill={'outline'}>
|
||||
<View className={'item flex justify-center flex-col items-center'}
|
||||
onClick={() => navTo('/user/order/order?statusFilter=6', true)}>
|
||||
<Refund size={26} className={'font-normal text-gray-500'}/>
|
||||
|
||||
Reference in New Issue
Block a user