Commit 637e6418 authored by GuanHua's avatar GuanHua

fix:1.商品logo链接问题;2.申请会员按钮添加确认提示;

parent 0264a1f0
......@@ -262,7 +262,7 @@ const CommodityDetail = (props) => {
}
/**
* 获取会员权益餐宿
* 获取会员权益参数
* @param memberId
* @param memberRoleId
*/
......
......@@ -35,10 +35,10 @@ const AboutUs: React.FC<AboutUsPropsType> = (props) => {
link = `/shop/about?shopId=${shopUrlParam}`
break
case LAYOUT_TYPE.channel:
link = `${GlobalConfig.channelRootRoute}/about?id=${shopUrlParam}`
link = `${GlobalConfig.channelRootRoute}/about?channelId=${shopUrlParam}`
break
case LAYOUT_TYPE.ichannel:
link = `${GlobalConfig.ichannelRootRoute}/about?id=${shopUrlParam}`
link = `${GlobalConfig.ichannelRootRoute}/about?channelId=${shopUrlParam}`
break
}
return link
......
......@@ -20,7 +20,7 @@
position: relative;
margin: auto 97px auto 20px;
&>img {
img {
display: block;
margin: 0 auto;
max-width: 145px;
......
......@@ -53,7 +53,9 @@ const Header: React.FC<HeaderPropsType> = (props) => {
<div className={styles.header}>
<div className={styles.header_container}>
<div className={styles.logo}>
<img src={shopInfo?.logo} />
<a href={`${type === LAYOUT_TYPE.channel ? GlobalConfig.channelRootRoute : GlobalConfig.ichannelRootRoute}?channelId=${shopUrlParam}`}>
<img src={shopInfo?.logo} />
</a>
</div>
<div className={styles.mall_search}>
<div className={styles.mall_search_box}>
......
import React from 'react'
import styles from './index.less'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
interface ShopHeaderPropsType {
title?: string;
......@@ -11,13 +12,31 @@ interface ShopHeaderPropsType {
const CommonHeader: React.FC<ShopHeaderPropsType> = (props) => {
const { title, logoUrl } = props
const { title, logoUrl, type, shopUrlParam } = props
const getLink = () => {
let url: string = ''
switch(type) {
case LAYOUT_TYPE.channel:
url = `${GlobalConfig.channelRootRoute}?channelId=${shopUrlParam}`
break
case LAYOUT_TYPE.ichannel:
url = `${GlobalConfig.ichannelRootRoute}?channelId=${shopUrlParam}`
break
default:
url = '/'
break
}
return url
}
return (
<div className={styles.common_header}>
<div className={styles.common_header_container}>
<div className={styles.logo}>
<img src={logoUrl} />
<a href={getLink()}>
<img src={logoUrl} />
</a>
</div>
<div className={styles.common_header_split}></div>
<div className={styles.common_header_title}>{title}</div>
......
......@@ -184,7 +184,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
return link
}
return (
return( list && list.length > 0) ? (
<div className={styles.recommand}>
<div className={styles.recommand_title}>买家还在看</div>
<div className={styles.recommand_list}>
......@@ -206,7 +206,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
}
</div>
</div>
)
) : null
}
export default inject('SiteStore')(observer(Recommand))
......@@ -55,7 +55,7 @@
height: 48px;
margin-right: 8px;
&>img {
img {
width: 48px;
height: 48px;
}
......
......@@ -95,7 +95,9 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
<div className={styles.shop_header_split}></div>
<div className={styles.shop_header_info}>
<div className={styles.shop_header_info_logo}>
<img src={shopInfo?.logo} />
<a href={`/shop?shopId=${shopUrlParam}`}>
<img src={shopInfo?.logo} />
</a>
</div>
<div className={styles.shop_header_info_content}>
<div className={styles.shop_header_info_content_name}>
......
import React, { useEffect, useState } from 'react'
import React, { Fragment, useEffect, useState } from 'react'
import {
BasicLayoutProps as ProLayoutProps,
getMenuData
} from '@ant-design/pro-layout'
import SelectLang from '@/layouts/components/SelectLang'
import { useIntl } from 'umi'
import { useIntl, Helmet } from 'umi'
import { LAYOUT_TYPE } from "@/constants"
import { inject, observer } from 'mobx-react'
import TopBar from '../components/TopBar'
......@@ -82,34 +82,41 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
}, [shopInfo])
return (
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} name={shopInfo?.company} type={LAYOUT_TYPE.ichannel} shopUrlParam={channelId} />
<div className={styles.content}>
<Fragment>
<Helmet>
{
!menuRouter?.hideHeader && (
<>
<ChannelHeader id={query.shopId} shopUrlParam={channelId} shopInfo={shopInfo} type={LAYOUT_TYPE.ichannel} />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.ichannel} memberId={query.memberId} shopId={query.shopId} shopUrlParam={channelId} />
</>
)
}
{
!loading ? shopInfo ? children && React.Children.map(children, (child: any) => {
return React.cloneElement(child,
{
layoutType: LAYOUT_TYPE.ichannel,
shopId: query.shopId,
memberId: query.memberId,
shopUrlParam: channelId,
shopInfo
},
);
}) : <SearchShopResult type={2} /> : null
shopInfo ? <title>{shopInfo.company}</title> : null
}
</Helmet>
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} name={shopInfo?.company} type={LAYOUT_TYPE.ichannel} shopUrlParam={channelId} />
<div className={styles.content}>
{
!menuRouter?.hideHeader && (
<>
<ChannelHeader id={query.shopId} shopUrlParam={channelId} shopInfo={shopInfo} type={LAYOUT_TYPE.ichannel} />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.ichannel} memberId={query.memberId} shopId={query.shopId} shopUrlParam={channelId} />
</>
)
}
{
!loading ? shopInfo ? children && React.Children.map(children, (child: any) => {
return React.cloneElement(child,
{
layoutType: LAYOUT_TYPE.ichannel,
shopId: query.shopId,
memberId: query.memberId,
shopUrlParam: channelId,
shopInfo
},
);
}) : <SearchShopResult type={2} /> : null
}
</div>
<Footer />
<SideNav type={LAYOUT_TYPE.ichannel} shopUrlParam={channelId} />
</div>
<Footer />
<SideNav type={LAYOUT_TYPE.ichannel} shopUrlParam={channelId} />
</div>
</Fragment>
)
}
......
......@@ -80,6 +80,7 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
let param = {
id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId,
payPassword: Number(payPassword)
}
setConfirmLoading(true)
......
......@@ -70,8 +70,9 @@ const TransferPayWay: React.FC<TransferPayWayPropsType> = (props) => {
return
}
let param = {
id: orderId,
id: Number(orderId),
paymentInformationId: payInfo.paymentInformationId,
payTypeId: payInfo.paymentChannelsId,
payOrderUrls: JSON.stringify([payOrderUrl])
}
setConfirmLoading(true)
......
import React from 'react'
import React, { useEffect } from 'react'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { LAYOUT_TYPE } from '@/constants'
import wechatIcon from '@/assets/imgs/wechat_icon.png'
import wechatImg from '@/assets/imgs/wechat.png'
import { priceFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import styles from './index.less'
import { useState } from 'react'
interface WechatPayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse,
orderInfo: any,
orderId: number,
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
}
const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
const { payInfo, orderId, onChange, orderInfo, layoutType, shopUrlParam } = props
const [wechatPayUrl, setWechatPayUrl] = useState<string>('')
useEffect(() => {
pay()
}, [])
const pay = () => {
let param = {
id: Number(orderId),
paymentInformationId: payInfo.paymentInformationId,
payTypeId: payInfo.paymentChannelsId,
}
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => {
// setWechatPayUrl(res.data)
}).catch(() => {
onChange(false)
})
}
return (
<>
......@@ -22,7 +53,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
</div>
<div className={styles.wechat_payway_needpay}>
<label>当前需支付:</label>
<span>20,000</span>
<span>{priceFormat(payInfo.payPrice)}</span>
<label>RMB</label>
</div>
</div>
......
......@@ -107,7 +107,7 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
case PayWayType.credit:
return <CreditPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.wechat:
return <WechatPayWay />
return <WechatPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.bank:
return <BankPayWay />
case PayWayType.transfer:
......
......@@ -24,7 +24,7 @@
padding-right: 60px;
}
.shop_about_btn {
.shop_about_btn {
padding: 0 15px;
height: 32px;
......@@ -347,4 +347,28 @@
}
}
}
}
.mallComfirm {
position: relative;
:global {
.ant-modal-confirm-btns {
.ant-btn {
&:hover {
color: var(--mall_main_color);
border-color: var(--mall_main_color);
}
}
.ant-btn-primary {
background-color: var(--mall_main_color);
border-color: var(--mall_main_color);
&:hover {
color: #ffffff;
}
}
}
}
}
\ No newline at end of file
import React, { useState, useEffect } from 'react'
import { Rate, Button, message } from 'antd'
import { Rate, Button, message, Modal } from 'antd'
import { LeftOutlined, RightOutlined } from '@ant-design/icons'
import cx from 'classnames'
import shop_icon from '@/assets/imgs/shop_icon.png'
......@@ -44,17 +44,34 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
const applyFroVip = () => {
if (shopInfo) {
let param = {
memberId: shopInfo.memberId,
roleId: shopInfo.roleId
}
setApplyLoading(true)
PublicApi.postMemberAbilityMallSubApply(param).then((res) => {
if (res.code === 1000) { }
setApplyLoading(false)
}).catch(() => {
setApplyLoading(false)
Modal.confirm({
centered: true,
className: styles.mallComfirm,
content: layoutType === LAYOUT_TYPE.shop ? `是否申请成为该店铺会员?` : '是否申请成为该渠道所属下级渠道会员?',
onOk: () => {
return new Promise((resolve, reject) => {
let param = {
memberId: shopInfo.memberId,
roleId: shopInfo.roleId
}
setApplyLoading(true)
PublicApi.postMemberAbilityMallSubApply(param).then((res) => {
if (res.code === 1000) {
resolve()
} else {
reject()
}
setApplyLoading(false)
}).catch(() => {
setApplyLoading(false)
reject()
})
})
}
})
}
}
......@@ -106,7 +123,7 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
{
layoutType === LAYOUT_TYPE.shop && <div className={cx(styles.shop_about_btn, collectState ? styles.active : "")} onClick={() => handleCollect()}>{collectState ? '已收藏本店' : '收藏本店'}</div>
}
<Button loading={applyLoading} className={cx(styles.shop_about_btn, styles.primary)} onClick={() => applyFroVip()}>申请成为本店会员</Button>
<Button loading={applyLoading} className={cx(styles.shop_about_btn, styles.primary)} onClick={() => applyFroVip()}>{layoutType === LAYOUT_TYPE.shop ? '申请成为本店会员' : '申请加盟'}</Button>
</div>
</div>
<div className={cx(styles.shop_about_info_item, styles.auto_width)}>
......@@ -137,7 +154,7 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
</div>
<div className={styles.shop_about_split}>
<div className={styles.shop_about_split_line}></div>
<div className={styles.shop_about_split_text}>公司 介绍</div>
<div className={styles.shop_about_split_text}>公司介绍</div>
<div className={styles.shop_about_split_line}></div>
</div>
<div className={styles.shop_workshopimg_list}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment