Commit f7d7a504 authored by GuanHua's avatar GuanHua

feat:修改店铺装修和渠道装修页面

parent 4d3b078c
{
"name": "god-template",
"name": "lingxi-business-paltform",
"version": "1.0.4",
"scripts": {
"api": "god-ytt",
"scripts:build": "node scripts/run",
......@@ -40,7 +41,7 @@
"copy-to-clipboard": "^3.3.1",
"god": "^0.1.27",
"lingxi-design": "^1.0.7",
"lingxi-design-ui": "^1.0.8",
"lingxi-design-ui": "^1.0.9",
"lingxi-editor-core": "^1.0.6",
"lingxi-web": "^1.0.6",
"lint-staged": "^10.0.7",
......
......@@ -44,7 +44,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const fetchAllShop = () => {
//@ts-ignore
PublicApi.getManageShopFindShopsBySiteId({ siteId }).then(res => {
PublicApi.getManageShopFindShopsBySiteId({ siteId, type: 2 }).then(res => {
if (res.code === 1000) {
setAllMallList(res.data)
}
......
export const menuData = [
{
"path": "/shop",
"name": "首页",
"key": "shopHome",
},
{
"path": "/shop/commodity",
"name": "商品",
"key": "shopCommodity",
},
{
"path": "/shop/pointsMall",
"name": "积分兑换",
"key": "shopPointsMall",
},
{
"path": "/shop/infomation",
"name": "资讯",
"key": "shopInfomation",
},
{
"path": "/shop/about",
"name": "关于我们",
"key": "shopAbout",
},
]
\ No newline at end of file
......@@ -4,8 +4,10 @@ import ToolBar from '../components/toolBar'
import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel'
import config from '../configs'
import { LAYOUT_TYPE } from '@/constants'
import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, CommonTitle1Config, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, AboutUsConfig, InformationConfig, FooterConfig } from './defaultData'
import Loading from './loading'
import { menuData } from './defaultMenu'
import { PublicApi } from '@/services/api'
import styles from './index.less'
......@@ -105,11 +107,31 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
})
}
/**
* 获取渠道信息
*/
const fetchShopInfo = () => {
return new Promise((resolve) => {
PublicApi.getTemplateChannelFindChannel().then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
const getComponentsConfig = async () => {
// 导航栏
mainNavConfig[mainNavConfig.key].props.menuData = menuData
mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.channel
mainNavConfig[mainNavConfig.key].props.categoryList = []
// 一号位广告
bannerAdvertConfig[bannerAdvertConfig.key].props.advertList = await findFirstAdvertsByType()
// 二号位广告
serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findSecondAdvertsByType()
//店铺信息
AboutUsConfig[AboutUsConfig.key].props.shopInfo = await fetchShopInfo()
let initIndex = 100
let floorLineConfig: any = {}
......@@ -176,7 +198,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
...InformationConfig,
...FooterConfig
}
console.log(config)
setComponentConfigs(config)
setLoading(false)
}
......
......@@ -10,7 +10,7 @@ export const mallLayoutConfig = {
"background": "#FFF"
}
},
"childNodes": ["1", "3", "4", "5", "18", "6"]
"childNodes": ["1", "3", "4", "5", "17", "18", "6"]
},
}
......@@ -40,7 +40,9 @@ export const headerConfig = {
key: "3",
"3": {
"componentName": "ShopHeader",
"props": {},
"props": {
"shopInfo": {}
},
},
}
......@@ -103,7 +105,9 @@ export const AboutUsConfig = {
key: "18",
"18": {
"componentName": "AboutUs",
"props": {},
"props": {
"shopInfo": {}
},
},
}
......@@ -123,135 +127,3 @@ export const FooterConfig = {
},
}
export default {
"0": {
"componentName": "MallLayout",
"props": {
"style": {
"width": "100%",
"minHeight": "100%"
}
},
"childNodes": ["1", "2", "3", "4", "5", "7", "8", "18", "19", "20"]
},
"1": {
"componentName": "TopBar",
"props": {
linkdisable: true
},
},
"2": {
"componentName": "Advert",
"props": {
"type": "top",
"linkdisable": true,
"advertList": []
},
},
"3": {
"componentName": "Header",
"props": {},
},
"4": {
"componentName": "MainNav",
"props": {},
},
"5": {
"componentName": "Advert",
"props": {
"type": "banner",
"hasQuickNav": true,
"linkdisable": true,
"advertList": []
// "advertList": [
// {
// id: 1,
// templateId: 707,
// type: 2,
// name: '意大利进口荔枝纹牛皮会员价促销最低 9 折',
// picUrl: 'https://img.alicdn.com/imgextra/i4/81/O1CN01VT5ViO1CT8h4sY7qc_!!81-0-luban.jpg_q100.jpg_.webp',
// link: 'https://www.baidu.com',
// sort: 1,
// },
// {
// id: 2,
// templateId: 707,
// type: 2,
// name: '意大利进口荔枝纹牛皮会员价促销最低 9 折',
// picUrl: 'https://img.alicdn.com/tps/i4/TB1ICgYL.H1gK0jSZSySuttlpXa.jpg',
// link: 'https://www.baidu.com',
// sort: 2,
// }
// ]
}
},
"7": {
"componentName": "Advert",
"props": {
"type": "interact",
"linkdisable": true,
"advertList": []
},
},
"8": {
"componentName": "FloorLine",
"props": {},
"childNodes": ["9", "10"]
},
"9": {
"componentName": "FloorLine.Horizontal",
"props": {},
"childNodes": ["11", "12"]
},
"10": {
"componentName": "FloorLine.Brand",
"props": {},
},
"11": {
"componentName": "FloorLine.Category",
"props": {},
},
"12": {
"componentName": "FloorLine.Vertical",
"props": {},
"childNodes": ["13", "15"]
},
"13": {
"componentName": "FloorLine.FloorHeader",
"props": {},
"childNodes": ["14"]
},
"14": {
"componentName": "FloorLine.Banner",
"props": {
"type": "category",
},
},
"15": {
"componentName": "FloorLine.Horizontal",
"props": {},
"childNodes": ["16", "17"]
},
"16": {
"componentName": "FloorLine.Goods",
"props": {},
},
"17": {
"componentName": "FloorLine.Shops",
"props": {},
},
"18": {
"componentName": "FindMore",
"props": {},
},
"19": {
"componentName": "Information",
"props": {},
},
"20": {
"componentName": "Footer",
"props": {},
},
}
\ No newline at end of file
export const menuData = [
{
"path": "/shop",
"name": "首页",
"key": "shopHome",
},
{
"path": "/shop/commodity",
"name": "商品",
"key": "shopCommodity",
},
{
"path": "/shop/pointsMall",
"name": "积分兑换",
"key": "shopPointsMall",
},
{
"path": "/shop/infomation",
"name": "资讯",
"key": "shopInfomation",
},
{
"path": "/shop/about",
"name": "关于我们",
"key": "shopAbout",
},
]
\ No newline at end of file
......@@ -4,7 +4,9 @@ import ToolBar from '../components/toolBar'
import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel'
import config from '../configs'
import { LAYOUT_TYPE } from '@/constants'
import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, CommonTitle1Config, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, AboutUsConfig, InformationConfig, FooterConfig } from './defaultData'
import { menuData } from './defaultMenu'
import Loading from './loading'
import { PublicApi } from '@/services/api'
import styles from './index.less'
......@@ -103,11 +105,33 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
})
}
/**
* 获取店铺信息
*/
const fetchShopInfo = () => {
return new Promise((resolve) => {
PublicApi.getTemplateShopFindShop().then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
const getComponentsConfig = async () => {
// 导航栏
mainNavConfig[mainNavConfig.key].props.menuData = menuData
mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.shop
mainNavConfig[mainNavConfig.key].props.categoryList = []
// 一号位广告
bannerAdvertConfig[bannerAdvertConfig.key].props.advertList = await findFirstAdvertsByType()
// 二号位广告
serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findSecondAdvertsByType()
//店铺信息
const shopInfo = await fetchShopInfo()
headerConfig[headerConfig.key].props.shopInfo = shopInfo
AboutUsConfig[AboutUsConfig.key].props.shopInfo = shopInfo
let initIndex = 100
let floorLineConfig: any = {}
......@@ -158,7 +182,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
initIndex += 100
}
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CommonTitle2Config.key, InformationConfig.key, FooterConfig.key]
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, InformationConfig.key, FooterConfig.key]
let config = {
...mallLayoutConfig,
...topBarConfig,
......@@ -166,11 +190,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...headerConfig,
...mainNavConfig,
...bannerAdvertConfig,
...CommonTitle2Config,
...AboutUsConfig,
...CommonTitle1Config,
...floorLineConfig,
...serviceAdvertConfig,
...CommonTitle2Config,
...InformationConfig,
...FooterConfig
}
......
......@@ -26,8 +26,6 @@ const AboutUs: React.FC<AboutUsPropsType> = (props) => {
}
}
const list = Array.apply({}, new Array(6))
return (
<div className={styles.channel_info_about} id="about_us">
<div className={styles.channel_info_about_container}>
......
......@@ -47,7 +47,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const fetchAllShop = () => {
//@ts-ignore
PublicApi.getManageShopFindShopsBySiteId({ siteId }).then(res => {
PublicApi.getManageShopFindShopsBySiteId({ siteId, type: 1 }).then(res => {
if (res.code === 1000) {
setAllMallList(res.data)
}
......
......@@ -115,8 +115,8 @@ class ApiRequest {
// 登录验证
if (res.code === 1101) {
removeAuth()
// history.replace('/user/login')
window.location.href = `/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`
history.replace(`/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`)
// window.location.href = `/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`
message.destroy()
message.error(res.message)
return false
......
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