Commit e92cf9c7 authored by xiexiuxing's avatar xiexiuxing

商城能力按钮完成

parent 54deb98b
# btnCode 是pass 平台配置唯一表示
# btnCode 是pass 平台配置唯一表示
......@@ -101,12 +101,31 @@
shopAbility.template.detail.detailInfo 店铺装修-详情-装修 店铺装修-详情-装修
shopAbility.template.detail.state 店铺装修-详情-状态 店铺装修-详情-使用中-按钮
# 商城能力
# 商城能力 (已完成)
- 1 自营商城管理-ownMallAbility
1.1 自营商城配置
ownMallConfigure.see 自营商城配置-查看网址 自营商城配置-查看网址-按钮
ownMallConfigure.state 自营商城配置-开关设置 自营商城配置-开关设置-按钮
ownMallConfigure.edit 自营商城配置-编辑 自营商城配置-编辑-按钮
1.2 自营商城模板管理
ownMallTemplate.see 自营商城模板管理-查看 自营商城模板管理-查看-按钮
1.2.1 自营商城模板管理详情
ownMallTemplate.detail.see 自营商城模板管理-详情-预览 自营商城模板管理-详情-预览-按钮 删除
ownMallTemplate.detail.renovation 自营商城模板管理-详情-装修 自营商城模板管理-详情-装修-按钮 删除
ownMallTemplate.detail.categoryrenovation 自营商城模板管理-详情-品类装修 自营商城模板管理-详情-品类装修-按钮 删除
ownMallTemplate.detail.state 自营商城模板管理-详情-状态 自营商城模板管理-详情-状态-按钮
1.3 自营商城SEO设置
ownMallSeo.add 自营商城SEO设置-新曾 自营商城SEO设置-新曾-按钮 删除
ownMallSeo.see 自营商城SEO设置-查看 自营商城SEO设置-查看-按钮 删除
ownMallSeo.del 自营商城SEO设置-删除 自营商城SEO设置-删除-按钮 删除
ownMallSeo.edit 自营商城SEO设置-修改 自营商城SEO设置-修改-按钮 删除
ownMallSeo.state 自营商城SEO设置-状态 自营商城SEO设置-状态-按钮
ownMallSeodetail.edit 自营商城SEO设置编辑 自营商城SEO设置编辑-按钮
ownMallSeodetail.add 自营商城SEO设置新曾 自营商城SEO设置新曾-按钮
# 渠道
# 采购能力
......@@ -121,7 +140,7 @@
# 物流能力
# 系统 - systemSetting
# 系统 - systemSetting (80%)
- 1.权限管理
......@@ -244,7 +263,7 @@
readySubmit.see 待提交报名查看 待提交报名查看-按钮
readySubmit.examine 待提交报名审核 待提交报名审核-按钮
# 4.商家优惠劵查询
- 4.商家优惠劵查询
- 4.1 商家优惠劵查询
merchantCouponQuery.see 商家优惠劵查询-查看 商家优惠劵查询-查看-按钮
merchantCouponQuery.cancel 商家优惠劵查询-取消 商家优惠劵查询-取消-按钮
......
......@@ -4,6 +4,7 @@ import cx from 'classnames'
import { Link, useIntl } from 'umi'
import default_img from '@/assets/imgs/template_default_img.png'
import styles from './index.less'
import AuthButton from '@/components/AuthButton'
interface TemplateItemPropsType {
templateInfo: any;
......@@ -35,7 +36,10 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
<div className={styles.template_item}>
<div className={styles.img_box} style={{ backgroundImage: `url(${templateInfo.templatePicUrl})` }}>
<div className={styles.img_box_mask}>
<Link to={`/memberCenter/ownMallAbility/ownMallManager/template/detail?type=${type}&id=${templateInfo.id}`} className={styles.detail_btn}>{intl.formatMessage({ id: 'common.button.view.details' })}</Link>
<AuthButton btnCode='ownMallTemplate.see' menuCode='ownMallAbility'>
<Link to={`/memberCenter/ownMallAbility/ownMallManager/template/detail?type=${type}&id=${templateInfo.id}`} className={styles.detail_btn}>{intl.formatMessage({ id: 'common.button.view.details' })}</Link>
</AuthButton>
</div>
<div className={cx(styles.type_tag, templateInfo.environment === 2 ? styles.h5 : '')}>{Environment_Status[templateInfo.environment].name}</div>
</div>
......@@ -49,12 +53,12 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
<div className={cx(styles.template_info_content, type === 'goods' ? styles.goods : '')}>
<div className={styles.template_info_content_text_wrap}>
<div className={styles.template_info_content_text_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.siteName' })}</label>
<label>{intl.formatMessage({ id: 'shop.template.form.label.siteName' })}</label>
<span>{templateInfo.siteName}</span>
</div>
<div className={styles.template_info_content_text_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.shopName' })}</label>
<label>{intl.formatMessage({ id: 'shop.template.form.label.shopName' })}</label>
<span>{templateInfo.shopName}</span>
</div>
</div>
......
......@@ -19,7 +19,7 @@ import { DOORTYPE } from '@/constants/procurement'
import TabAnchor from '@/components/TabAnchor'
import styles from './index.less'
import { getTemplateWebSeoWebGet, postTemplateWebSeoWebAdd, postTemplateWebSeoWebUpdate } from '@/services/TemplateV2Api';
import AuthButton from '@/components/AuthButton'
const layout: any = {
colon: false,
......@@ -91,9 +91,13 @@ const SeoAdd = () => {
className={styles.container}
extra={
!isView ?
[<Button key="1" type="primary" icon={<SaveOutlined />} onClick={onSave} loading={saveLoading}>{intl.formatMessage({ id: 'common.button.save' })}</Button>]
:
null
[
<AuthButton btnCode={id ? 'ownMallSeodetail.edit' : 'wnMallSeodetail.add'} menuCode='ownMallAbility'>
<Button key="1" type="primary" icon={<SaveOutlined />} onClick={onSave} loading={saveLoading}>{intl.formatMessage({ id: 'common.button.save' })}</Button>
</AuthButton>
]
:
null
}
>
<TabAnchor tabLink={tabLink} />
......@@ -124,13 +128,13 @@ const SeoAdd = () => {
<Col span={12}>
<Form.Item
name='title'
label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.title' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.title.tip' })}><QuestionCircleOutlined /></Tooltip>} />}
label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.title' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.title.tip' })}><QuestionCircleOutlined /></Tooltip>} />}
rules={[
{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.title.required' }) },
{ validator: (r, v, c) => validatorByte(r, v, c, 100) }
]}
>
<Input placeholder={`${intl.formatMessage({id: 'common.text.longest'})}100${intl.formatMessage({id: 'common.unit.individual.character'})}, 50${intl.formatMessage({id: 'common.unit.individual.chinese'})}`} disabled={isView} />
<Input placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}100${intl.formatMessage({ id: 'common.unit.individual.character' })}, 50${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`} disabled={isView} />
</Form.Item>
</Col>
<Col span={12}>
......@@ -138,11 +142,11 @@ const SeoAdd = () => {
name='description'
label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.description' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.description.tip' })}><QuestionCircleOutlined /></Tooltip>} />}
rules={[
{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.description.required' })},
{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.description.required' }) },
{ validator: (r, v, c) => validatorByte(r, v, c, 400) }
]}
>
<Input.TextArea rows={1} placeholder={`${intl.formatMessage({id: 'common.text.longest'})}400${intl.formatMessage({id: 'common.unit.individual.character'})}, 200${intl.formatMessage({id: 'common.unit.individual.chinese'})}`} disabled={isView} />
<Input.TextArea rows={1} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}400${intl.formatMessage({ id: 'common.unit.individual.character' })}, 200${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`} disabled={isView} />
</Form.Item>
</Col>
<Col span={12}>
......
......@@ -14,6 +14,8 @@ import { PlusOutlined } from '@ant-design/icons'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { DOORTYPE } from '@/constants/procurement'
import { getTemplateWebSeoWebPage, postTemplateWebSeoWebDelete, postTemplateWebSeoWebUpdateStatus } from '@/services/TemplateV2Api';
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const formActions = createFormActions();
......@@ -52,13 +54,16 @@ const schema: ISchema = {
const controllerBtns = <Row>
<Col span={6}>
<Button
onClick={() => history.push('/memberCenter/ownMallAbility/ownMallManager/ownMallSeo/add')}
type="primary"
icon={<PlusOutlined />}
>
<FormattedMessage id='common.button.add' />
</Button>
<AuthButton btnCode='ownMallSeo.add' menuCode='ownMallAbility'>
<Button
onClick={() => history.push('/memberCenter/ownMallAbility/ownMallManager/ownMallSeo/add')}
type="primary"
icon={<PlusOutlined />}
>
<FormattedMessage id='common.button.add' />
</Button>
</AuthButton>
</Col>
</Row>
......@@ -76,7 +81,7 @@ const SeoList: React.FC<{}> = () => {
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => (
<EyePreview url={`/memberCenter/ownMallAbility/ownMallManager/ownMallSeo/view?id=${record.id}`}>
<EyePreview type={AuthUrl('ownMallSeo.see', 'ownMallAbility') ? 'link' : 'button'} url={`/memberCenter/ownMallAbility/ownMallManager/ownMallSeo/view?id=${record.id}`}>
{text}
</EyePreview>
)
......@@ -93,11 +98,14 @@ const SeoList: React.FC<{}> = () => {
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
<AuthButton btnCode='ownMallSeo.state' menuCode='ownMallAbility'>
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
</AuthButton>
)
},
{
......@@ -106,13 +114,18 @@ const SeoList: React.FC<{}> = () => {
dataIndex: 'operate',
render: (_, record) => !record.status && (
<>
<Button type='link' onClick={() => history.push(`/memberCenter/ownMallAbility/ownMallManager/ownMallSeo/edit?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleDelete(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
<AuthButton btnCode='ownMallSeo.edit' menuCode='ownMallAbility'>
<Button type='link' onClick={() => history.push(`/memberCenter/ownMallAbility/ownMallManager/ownMallSeo/edit?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
</AuthButton>
<AuthButton btnCode='ownMallSeo.del' menuCode='ownMallAbility'>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleDelete(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
</AuthButton>
</>
)
}
......
......@@ -5,6 +5,7 @@ import TemplateItem from '../components/templateItem'
import { getTemplateWebPageTemplateWebFindAllSelfTemplate, GetTemplateWebPageTemplateWebFindAllSelfTemplateResponse } from '@/services/TemplateV2Api'
import styles from './index.less'
const OwnMallTemplate: React.FC = () => {
const [templateList, setTemplateList] = useState<GetTemplateWebPageTemplateWebFindAllSelfTemplateResponse>([])
......
......@@ -8,7 +8,7 @@ import UseModal from '../components/useModal'
import { Environment_Status } from '@/constants'
import styles from './index.less'
import { getTemplateWebPageTemplateWebFindSelfTemplateDetails, postTemplateWebPageTemplateWebUseSelfTemplate } from '@/services/TemplateV2Api'
import AuthButton from '@/components/AuthButton'
interface TemplateDetailPropsType {
location: {
query: {
......@@ -60,10 +60,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const handleLinkEdit = () => {
if(detailInfo?.environment === 1) {
if (detailInfo?.environment === 1) {
// 自营商城装修
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}`
} else if(detailInfo?.environment === 4 || detailInfo?.environment === 3 || detailInfo?.environment === 2) {
} else if (detailInfo?.environment === 4 || detailInfo?.environment === 3 || detailInfo?.environment === 2) {
// 自营商城装修
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}&environment=${detailInfo?.environment}`
} else {
......@@ -72,9 +72,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const handleLinkPreview = () => {
if(detailInfo?.environment === 1) {
if (detailInfo?.environment === 1) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}`
} else if(detailInfo?.environment === 4 || detailInfo?.environment === 3 || detailInfo?.environment === 2) {
} else if (detailInfo?.environment === 4 || detailInfo?.environment === 3 || detailInfo?.environment === 2) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}&environment=${detailInfo?.environment}`
} else {
message.info(intl.formatMessage({ id: 'shop.template.preview.tip' }))
......@@ -100,7 +100,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
<img src={detailInfo?.templatePicUrl} />
</div>
<div className={styles.template_info}>
<div className={styles.template_info_line}>
<div className={styles.template_info_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.templateName' })}</label>
<span>{detailInfo?.templateName}</span>
</div>
......@@ -109,11 +109,11 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
<span>{Environment_Status[detailInfo?.environment]}</span>
</div>
<div className={styles.template_info_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.templateDescribe' })}</label>
<label>{intl.formatMessage({ id: 'shop.template.form.label.templateDescribe' })}</label>
<span>{detailInfo?.templateDescribe}</span>
</div>
<div className={styles.template_info_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.siteName' })}</label>
<label>{intl.formatMessage({ id: 'shop.template.form.label.siteName' })}</label>
<span>{detailInfo?.siteName}</span>
</div>
<div className={styles.template_info_line}>
......@@ -122,26 +122,37 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
</div>
</div>
<div className={styles.btn} onClick={() => handleLinkPreview()}>
<EyeOutlined />
<label>{intl.formatMessage({ id: 'common.button.preview' })}</label>
</div>
<div className={cx(styles.btn, styles.fit)} onClick={() => handleLinkEdit()}>
<LayoutOutlined />
<label>{intl.formatMessage({ id: 'own.template.button.mall.edit' })}</label>
</div>
{
(detailInfo?.environment === 4 || detailInfo?.environment === 3) && (
<div className={cx(styles.btn, styles.fit)} onClick={() => handleCategoryJump()}>
<LayoutOutlined />
<label>{intl.formatMessage({ id: 'own.template.button.mall.category.edit' })}</label>
</div>
)
}
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => detailInfo?.use !== 1 ? setUseModalVisible(true) : {}}>
<PushpinOutlined />
<label>{detailInfo?.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.using' }) : intl.formatMessage({ id: 'shop.template.button.state.use' })}</label>
</div>
<AuthButton btnCode='ownMallTemplate.detail.see' menuCode='ownMallAbility'>
<div className={styles.btn} onClick={() => handleLinkPreview()}>
<EyeOutlined />
<label>{intl.formatMessage({ id: 'common.button.preview' })}</label>
</div>
</AuthButton>
<AuthButton btnCode='ownMallTemplate.detail.renovation' menuCode='ownMallAbility'>
<div className={cx(styles.btn, styles.fit)} onClick={() => handleLinkEdit()}>
<LayoutOutlined />
<label>{intl.formatMessage({ id: 'own.template.button.mall.edit' })}</label>
</div>
</AuthButton>
<AuthButton btnCode='ownMallTemplate.detail.categoryrenovation' menuCode='ownMallAbility'>
{
(detailInfo?.environment === 4 || detailInfo?.environment === 3) && (
<div className={cx(styles.btn, styles.fit)} onClick={() => handleCategoryJump()}>
<LayoutOutlined />
<label>{intl.formatMessage({ id: 'own.template.button.mall.category.edit' })}</label>
</div>
)
}
</AuthButton>
<AuthButton btnCode='ownMallTemplate.detail.state' menuCode='ownMallAbility'>
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => detailInfo?.use !== 1 ? setUseModalVisible(true) : {}}>
<PushpinOutlined />
<label>{detailInfo?.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.using' }) : intl.formatMessage({ id: 'shop.template.button.state.use' })}</label>
</div>
</AuthButton>
<UseModal
title={intl.formatMessage({ id: 'own.template.modal.title.use' })}
......
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