Commit 3805787c authored by XieZhiXiong's avatar XieZhiXiong
parents ce9c3ee3 489e0557
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
background-color: #ffffff; background-color: #ffffff;
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
height: 100%;
padding-bottom: 24px; padding-bottom: 24px;
margin-bottom: 24px;
.img_box { .img_box {
position: relative; position: relative;
......
import React, { forwardRef, useState, useCallback } from 'react' import React, { forwardRef, useState, useCallback } from 'react'
import { Button, Input } from 'antd' import { Button, Input, Modal } from 'antd'
import UploadImage from '@/components/UploadImage' import UploadImage from '@/components/UploadImage'
import { filterPropsFunction, getAdvertType } from '../../../../utils' import { filterPropsFunction, getAdvertType } from '../../../../utils'
import SettingPanel from '../../../../components/SettingPanel' import SettingPanel from '../../../../components/SettingPanel'
...@@ -243,9 +243,25 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref) ...@@ -243,9 +243,25 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
} }
const handleCancel = useCallback(() => {
if (JSON.stringify(props) !== JSON.stringify(newProps)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
onOk: () => {
clearSelectedStatus()
}
})
} else {
clearSelectedStatus()
}
}, [newProps])
return ( return (
<SettingPanel <SettingPanel
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onCancel={handleCancel}
onOK={handleConfirmSave} onOK={handleConfirmSave}
> >
<div className={styles.advert_setting}> <div className={styles.advert_setting}>
......
import React, { useState, useEffect } from 'react' import React, { useState, useEffect, useCallback } from 'react'
import { clearSelectedStatus, changeProps } from 'lingxi-editor-core' import { clearSelectedStatus, changeProps } from 'lingxi-editor-core'
import { Row, Col, Button, Input, Pagination, Form, message } from 'antd' import { Row, Col, Button, Input, Pagination, Form, message, Modal } from 'antd'
import SettingList from '../../../../components/SettingList' import SettingList from '../../../../components/SettingList'
import BrandItem from './BrandItem' import BrandItem from './BrandItem'
import SettingPanel from '../../../../components/SettingPanel' import SettingPanel from '../../../../components/SettingPanel'
...@@ -160,10 +160,24 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => { ...@@ -160,10 +160,24 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
setBrandIds(keys) setBrandIds(keys)
setSelectList(selectBrandList) setSelectList(selectBrandList)
} }
const handleCancel = () => {
if (JSON.stringify(brandList) !== JSON.stringify(selectBrandList)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
onOk: () => {
clearSelectedStatus()
}
})
} else {
clearSelectedStatus()
}
}
return ( return (
<SettingPanel <SettingPanel
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onCancel={handleCancel}
onOK={() => handleConfirm()} onOK={() => handleConfirm()}
> >
<div className={styles.goods_setting}> <div className={styles.goods_setting}>
......
import React, { useState, useEffect, useCallback } from 'react' import React, { useState, useEffect, useCallback } from 'react'
import { Checkbox, Row, Col, message } from 'antd' import { Checkbox, Row, Col, message, Modal } from 'antd'
import UploadImage from '@/components/UploadImage' import UploadImage from '@/components/UploadImage'
import SettingPanel from '../../../../components/SettingPanel' import SettingPanel from '../../../../components/SettingPanel'
import { clearSelectedStatus, changeProps } from 'lingxi-editor-core' import { clearSelectedStatus, changeProps } from 'lingxi-editor-core'
...@@ -19,41 +19,6 @@ interface CategoryRecommendSettingPropsType { ...@@ -19,41 +19,6 @@ interface CategoryRecommendSettingPropsType {
categoryid?: number; categoryid?: number;
} }
const mock_category_list = [
{
categoryId: 1,
categoryName: '牛皮'
},
{
categoryId: 2,
categoryName: '羊皮'
},
{
categoryId: 3,
categoryName: '猪皮'
},
{
categoryId: 4,
categoryName: '马皮'
},
{
categoryId: 5,
categoryName: '小牛皮'
},
{
categoryId: 6,
categoryName: '猪皮'
},
{
categoryId: 7,
categoryName: '羊皮'
},
{
categoryId: 8,
categoryName: '猪皮'
}
]
const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (props) => { const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (props) => {
console.log(props) console.log(props)
const { secondCategoryList = [], categoryAdvertPicUrl = '', onChange, templateid, categoryid } = props const { secondCategoryList = [], categoryAdvertPicUrl = '', onChange, templateid, categoryid } = props
...@@ -124,6 +89,21 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p ...@@ -124,6 +89,21 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
}) })
}, [newProps]) }, [newProps])
const handleCancel = useCallback(() => {
if (JSON.stringify(props) !== JSON.stringify(newProps)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
onOk: () => {
clearSelectedStatus()
}
})
} else {
clearSelectedStatus()
}
}, [newProps])
const saveCategory = (data: any) => { const saveCategory = (data: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const { categoryAdvertPicUrl } = data const { categoryAdvertPicUrl } = data
...@@ -152,6 +132,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p ...@@ -152,6 +132,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
return ( return (
<SettingPanel <SettingPanel
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onCancel={handleCancel}
onOK={handleConfirmSave} onOK={handleConfirmSave}
> >
<div className={styles.category_recommend}> <div className={styles.category_recommend}>
......
...@@ -18,7 +18,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => { ...@@ -18,7 +18,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
<div className={styles.goods_item_info_name}>{dataInfo.goodsName}</div> <div className={styles.goods_item_info_name}>{dataInfo.goodsName}</div>
<div className={styles.goods_item_info_price}> <div className={styles.goods_item_info_price}>
<i></i> <i></i>
<span>{dataInfo.priceRange}</span> <span>{dataInfo.priceRange || dataInfo.goodsPrice}</span>
</div> </div>
<div className={styles.goods_item_info_brief}> <div className={styles.goods_item_info_brief}>
<span>品类:</span> <span>品类:</span>
......
import React, { useState, useEffect, useCallback } from 'react' import React, { useState, useEffect } from 'react'
import { clearSelectedStatus, changeProps } from 'lingxi-editor-core' import { clearSelectedStatus, changeProps } from 'lingxi-editor-core'
import { Row, Col, Button, Input, Pagination, Select, Form, message } from 'antd' import { Row, Col, Button, Input, Pagination, Select, Form, message, Modal } from 'antd'
import SettingList from '../../../../components/SettingList' import SettingList from '../../../../components/SettingList'
import GoodsItem from './GoodsItem' import GoodsItem from './GoodsItem'
import SettingPanel from '../../../../components/SettingPanel' import SettingPanel from '../../../../components/SettingPanel'
...@@ -44,16 +44,53 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -44,16 +44,53 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const [filterParam, setFilterParam] = useState() const [filterParam, setFilterParam] = useState()
const [newProps, setNewProps] = useState(props) const [newProps, setNewProps] = useState(props)
const [categoryResponseList, setCategoryResponseList] = useState<any>([])
const [noSelectBrands, setNoSelectBrands] = useState<any[]>([])
const changeNewProps = (key: string, data: any) => { const changeNewProps = (key: string, data: any) => {
const newProps = { ...props } const newProps = { ...props }
newProps[key] = data newProps[key] = data
setNewProps(newProps) setNewProps(newProps)
} }
useEffect(() => {
fetchBrandsList()
fetchCategoryList()
}, [])
useEffect(() => { useEffect(() => {
fetchGoodsList() fetchGoodsList()
}, [filterParam]) }, [filterParam])
const fetchCategoryList = () => {
let param = {
categoryId: categoryid,
templateId: templateid
}
//@ts-ignore
PublicApi.getTemplatePlatformFindCategoryList(param).then(res => {
const data = res.data
setCategoryResponseList(data.categoryBOList || [])
})
}
const fetchBrandsList = () => {
let param = {
type: 0,
templateId: templateid,
categoryId: categoryid,
current: 1,
pageSize: 100
}
//@ts-ignore
PublicApi.getTemplatePlatformFindBrandList(param).then((res: any) => {
if (res.code === 1000) {
const dataInfo = res.data
setNoSelectBrands(dataInfo.data || [])
}
})
}
const fetchGoodsList = () => { const fetchGoodsList = () => {
let param = { let param = {
type: 0, type: 0,
...@@ -63,7 +100,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -63,7 +100,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
pageSize pageSize
} }
if (filterParam) { if (filterParam) {
param = Object.assign(param, filterParam) param = Object.assign(param, filterParam)
console.log(filterParam, param)
} }
//@ts-ignore //@ts-ignore
PublicApi.getTemplatePlatformFindGoodsList(param).then((res: any) => { PublicApi.getTemplatePlatformFindGoodsList(param).then((res: any) => {
...@@ -105,6 +144,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -105,6 +144,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const handleSearch = () => { const handleSearch = () => {
setCurrent(1) setCurrent(1)
console.log(form.getFieldsValue())
let param = filterProps(form.getFieldsValue()) let param = filterProps(form.getFieldsValue())
setFilterParam(param) setFilterParam(param)
} }
...@@ -122,22 +162,30 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -122,22 +162,30 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
} }
const handleConfirmSave = () => { const handleConfirmSave = () => {
console.log('handleConfirmSave1')
if (JSON.stringify(goodsList) === JSON.stringify(selectGoodsList)) { if (JSON.stringify(goodsList) === JSON.stringify(selectGoodsList)) {
return return
} }
console.log('handleConfirmSave2')
if (selectGoodsList.length <= 0) { if (selectGoodsList.length <= 0) {
message.error("请选择要推荐的商品") message.error("请选择要推荐的商品")
return return
} }
setConfirmLoading(true) setConfirmLoading(true)
let newList = JSON.parse(JSON.stringify(selectGoodsList))
newList = newList.map(item => {
let minPrice = 0
if (item.priceRange && typeof item.priceRange === 'string') {
minPrice = item.priceRange.split("~")[0]
item.goodsPrice = minPrice
}
return item
})
saveGoods().then(() => { saveGoods().then(() => {
changeProps({ changeProps({
props: { props: {
templateid, templateid,
categoryid, categoryid,
goodsList: selectGoodsList goodsList: newList
} }
}) })
clearSelectedStatus() clearSelectedStatus()
...@@ -147,6 +195,21 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -147,6 +195,21 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}) })
} }
const handleCancel = () => {
if (JSON.stringify(goodsList) !== JSON.stringify(selectGoodsList)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
onOk: () => {
clearSelectedStatus()
}
})
} else {
clearSelectedStatus()
}
}
const saveGoods = () => { const saveGoods = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let param: any = { let param: any = {
...@@ -182,6 +245,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -182,6 +245,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
return ( return (
<SettingPanel <SettingPanel
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onCancel={handleCancel}
onOK={() => handleConfirm()} onOK={() => handleConfirm()}
> >
<div className={styles.goods_setting}> <div className={styles.goods_setting}>
...@@ -246,7 +310,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -246,7 +310,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
name="supplyName" name="supplyName"
className={styles.mar_bot_0} className={styles.mar_bot_0}
> >
<Input placeholder="供应会员" /> <Input placeholder="供应会员" onPressEnter={handleSearch} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={6}> <Col span={6}>
...@@ -254,8 +318,10 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -254,8 +318,10 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
name="twoCategoryId" name="twoCategoryId"
className={styles.mar_bot_0} className={styles.mar_bot_0}
> >
<Select placeholder="品类" style={{ width: 180 }}> <Select placeholder="品类" style={{ width: 180 }} onChange={handleSearch}>
<Select.Option value="1">1</Select.Option> {
categoryResponseList.map((item, index) => <Select.Option kye={`select_category_item_${index}`} value={item.categoryId}>{item.categoryName}</Select.Option>)
}
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -264,8 +330,11 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -264,8 +330,11 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
name="brandId" name="brandId"
className={styles.mar_bot_0} className={styles.mar_bot_0}
> >
<Select placeholder="品牌" style={{ width: 180 }}> <Select placeholder="品牌" style={{ width: 180 }} onChange={handleSearch}>
<Select.Option value="1">1</Select.Option> {
noSelectBrands.map((item, index) => (<Select.Option kye={`select_brand_item_${index}`} value={item.brandId}>{item.brandName}</Select.Option>))
}
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
......
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import { clearSelectedStatus, changeProps } from 'lingxi-editor-core' import { clearSelectedStatus, changeProps } from 'lingxi-editor-core'
import { Row, Col, Button, Input, Pagination, Form, message } from 'antd' import { Row, Col, Button, Input, Pagination, Form, message, Modal } from 'antd'
import SettingList from '../../../../components/SettingList' import SettingList from '../../../../components/SettingList'
import ShopItem from './ShopItem' import ShopItem from './ShopItem'
import SettingPanel from '../../../../components/SettingPanel' import SettingPanel from '../../../../components/SettingPanel'
...@@ -130,6 +130,21 @@ const ShopSetting: React.FC<ShopSettingPropsType> = (props) => { ...@@ -130,6 +130,21 @@ const ShopSetting: React.FC<ShopSettingPropsType> = (props) => {
}) })
} }
const handleCancel = () => {
if (JSON.stringify(shopsList) !== JSON.stringify(selectShopsList)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
onOk: () => {
clearSelectedStatus()
}
})
} else {
clearSelectedStatus()
}
}
const saveShop = () => { const saveShop = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let param: any = { let param: any = {
...@@ -165,6 +180,7 @@ const ShopSetting: React.FC<ShopSettingPropsType> = (props) => { ...@@ -165,6 +180,7 @@ const ShopSetting: React.FC<ShopSettingPropsType> = (props) => {
return ( return (
<SettingPanel <SettingPanel
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onCancel={handleCancel}
onOK={() => handleConfirm()} onOK={() => handleConfirm()}
> >
<div className={styles.goods_setting}> <div className={styles.goods_setting}>
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
padding: 10px !important; padding: 10px !important;
} }
.ant-drawer-title {
font-weight: bold;
}
.children-container { .children-container {
background: #ffffff; background: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.15); border: 1px solid rgba(0, 0, 0, 0.15);
......
...@@ -7,7 +7,7 @@ import { inject } from 'mobx-react' ...@@ -7,7 +7,7 @@ import { inject } from 'mobx-react'
import UseModal from '../components/useModal' import UseModal from '../components/useModal'
import DetailPage from '@/components/DetailPage' import DetailPage from '@/components/DetailPage'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetTemplatePlatformFindTemplateDetailsResponse } from '@/services' import { GetTemplatePlatformFindTemplateDetailsResponse } from '@/services/TemplateApi'
import styles from './index.less' import styles from './index.less'
interface TemplateDetailPropsType { interface TemplateDetailPropsType {
...@@ -20,21 +20,23 @@ interface TemplateDetailPropsType { ...@@ -20,21 +20,23 @@ interface TemplateDetailPropsType {
} }
} }
const Environment_Status = { const Environment_Status = {
0: {
name: "所有"
},
1: { 1: {
name: "PC " name: "web"
}, },
2: { 2: {
name: "H5 " name: "H5"
}, },
3: { 3: {
name: "APP " name: "小程序"
},
4: {
name: "APP"
} }
} }
const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const { query: { type, id } } = props.location const { query: { type, id } } = props.location
const { siteId } = props.SiteStore const { siteId } = props.SiteStore
......
import React, {Component} from 'react'; import React, { Component } from 'react';
import { Button, Row, Col, Form, Input, message } from 'antd'; import { Button, Row, Col, Form, Input, message } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
import { UserOutlined, LockOutlined, CloudFilled, SafetyOutlined } from '@ant-design/icons'; import { UserOutlined, LockOutlined, CloudFilled, SafetyOutlined } from '@ant-design/icons';
...@@ -29,7 +29,7 @@ async function fakeAccountLogin(params: { password: string; username: string }) ...@@ -29,7 +29,7 @@ async function fakeAccountLogin(params: { password: string; username: string })
class Index extends Component<{}, IndexState> { class Index extends Component<{}, IndexState> {
private timer: number | undefined; private timer: number | undefined;
constructor(props:any) { constructor(props: any) {
super(props); super(props);
this.state = { this.state = {
isOften: false, isOften: false,
...@@ -48,14 +48,14 @@ class Index extends Component<{}, IndexState> { ...@@ -48,14 +48,14 @@ class Index extends Component<{}, IndexState> {
isLoading: true isLoading: true
}) })
// @ts-ignore // @ts-ignore
this.timer = setInterval(()=>{ this.timer = setInterval(() => {
this.handleTimer() this.handleTimer()
}, 1000) }, 1000)
} }
handleTimer() { handleTimer() {
const { timeNumber } = this.state const { timeNumber } = this.state
if(timeNumber > 0){ if (timeNumber > 0) {
let n = timeNumber - 1 let n = timeNumber - 1
this.setState({ this.setState({
timeNumber: n, timeNumber: n,
...@@ -63,7 +63,7 @@ class Index extends Component<{}, IndexState> { ...@@ -63,7 +63,7 @@ class Index extends Component<{}, IndexState> {
btnText: `${n}s 后重发`, btnText: `${n}s 后重发`,
isLoading: false isLoading: false
}) })
}else{ } else {
clearInterval(this.timer) clearInterval(this.timer)
this.setState({ this.setState({
timeNumber: 60, timeNumber: 60,
...@@ -77,9 +77,11 @@ class Index extends Component<{}, IndexState> { ...@@ -77,9 +77,11 @@ class Index extends Component<{}, IndexState> {
clearInterval(this.timer) clearInterval(this.timer)
} }
onFinish = (values:any) => { onFinish = (values: any) => {
console.log('Received values of form: ', values); console.log('Received values of form: ', values);
PublicApi.postMemberManageLogin(values).then(res => { PublicApi.postMemberManageLogin(values).then(res => {
message.destroy()
message.success("登录成功")
const { data } = res const { data } = res
setAuth(data) setAuth(data)
setRouters(data.urls) setRouters(data.urls)
...@@ -149,11 +151,11 @@ class Index extends Component<{}, IndexState> { ...@@ -149,11 +151,11 @@ class Index extends Component<{}, IndexState> {
> >
<Input <Input
size="large" size="large"
placeholder="输入验证码"/> placeholder="输入验证码" />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Button loading={isLoading} className="send-code" onClick={()=>{this.handleSendVerifyCode()}} disabled={isBan} size="large">{btnText}</Button> <Button loading={isLoading} className="send-code" onClick={() => { this.handleSendVerifyCode() }} disabled={isBan} size="large">{btnText}</Button>
</Col> </Col>
</Row> </Row>
</Form.Item> </Form.Item>
...@@ -162,7 +164,7 @@ class Index extends Component<{}, IndexState> { ...@@ -162,7 +164,7 @@ class Index extends Component<{}, IndexState> {
{ {
isLongTime && ( isLongTime && (
<Form.Item> <Form.Item>
<Button icon={ <CloudFilled />} size="large" className="verify-btn"> <Button icon={<CloudFilled />} size="large" className="verify-btn">
点击按钮进行验证 点击按钮进行验证
</Button> </Button>
</Form.Item> </Form.Item>
......
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