Commit 0475a7a6 authored by GuanHua's avatar GuanHua

feat: app渠道商城装修页面开发

parent aefd60d5
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#606266" d="M170.666667 810.666667a42.666667 42.666667 0 0 1 0-85.333334L597.333333 725.333333a42.666667 42.666667 0 0 1 1e-8 85.333334l-426.66666601 0z m0-255.99999999a42.666667 42.666667 0 0 1 0-85.33333402L853.333333 469.33333299a42.666667 42.666667 0 0 1 0 85.33333402l-682.666666 0z m0-256.00000001a42.666667 42.666667 0 0 1 0-85.333334l255.99999999 0a42.666667 42.666667 0 0 1 1e-8 85.333334l-256 0z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M170.666667 810.666667a42.666667 42.666667 0 0 1 0-85.333334L597.333333 725.333333a42.666667 42.666667 0 0 1 1e-8 85.333334l-426.66666601 0z m0-255.99999999a42.666667 42.666667 0 0 1 0-85.33333402L853.333333 469.33333299a42.666667 42.666667 0 0 1 0 85.33333402l-682.666666 0z m0-256.00000001a42.666667 42.666667 0 0 1 0-85.333334l255.99999999 0a42.666667 42.666667 0 0 1 1e-8 85.333334l-256 0z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#606266" d="M800 256c35.346 0 64 28.654 64 64v64h32c35.346 0 64 28.654 64 64v128c0 35.346-28.654 64-64 64h-32v64c0 35.346-28.654 64-64 64H128c-35.346 0-64-28.654-64-64V320c0-35.346 28.654-64 64-64h672z m96 320V448h-96V320H128v384h672V576h96z" /><path fill="#606266" d="M188 356h552q24 0 24 24v264q0 24-24 24H188q-24 0-24-24V380q0-24 24-24z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M800 256c35.346 0 64 28.654 64 64v64h32c35.346 0 64 28.654 64 64v128c0 35.346-28.654 64-64 64h-32v64c0 35.346-28.654 64-64 64H128c-35.346 0-64-28.654-64-64V320c0-35.346 28.654-64 64-64h672z m96 320V448h-96V320H128v384h672V576h96z" /><path fill="#ffffff" d="M188 356h552q24 0 24 24v264q0 24-24 24H188q-24 0-24-24V380q0-24 24-24z" /></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="16px" viewBox="0 0 12 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>headphones</title>
<g id="😀设计稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="B.1.1-渠道商城-首页--白色" transform="translate(-343.000000, -51.000000)" fill="#303133">
<g id="头部可替换模块" transform="translate(0.000000, -0.000000)">
<g id="headphones" transform="translate(339.000000, 49.000000)">
<path d="M15.8333333,16.6666667 C15.8333333,17.1266667 15.4608333,17.5 15,17.5 C14.5391667,17.5 14.1666667,17.1266667 14.1666667,16.6666667 C14.1666667,14.3691667 12.2975,12.5 10,12.5 C7.7025,12.5 5.83333333,14.3691667 5.83333333,16.6666667 C5.83333333,17.1266667 5.46083333,17.5 5,17.5 C4.53916667,17.5 4.16666667,17.1266667 4.16666667,16.6666667 C4.16666667,13.45 6.78416667,10.8333333 10,10.8333333 C13.2158333,10.8333333 15.8333333,13.45 15.8333333,16.6666667 M10,4.16666667 C10.9191667,4.16666667 11.6666667,4.91416667 11.6666667,5.83333333 C11.6666667,6.7525 10.9191667,7.5 10,7.5 C9.08083333,7.5 8.33333333,6.7525 8.33333333,5.83333333 C8.33333333,4.91416667 9.08083333,4.16666667 10,4.16666667 M10,9.16666667 C11.8383333,9.16666667 13.3333333,7.67166667 13.3333333,5.83333333 C13.3333333,3.995 11.8383333,2.5 10,2.5 C8.16166667,2.5 6.66666667,3.995 6.66666667,5.83333333 C6.66666667,7.67166667 8.16166667,9.16666667 10,9.16666667" id="🎨-Icon-Сolor"></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="16px" viewBox="0 0 12 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>headphones</title>
<g id="😀设计稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="B.1.1-渠道商城-首页-有颜色" transform="translate(-347.000000, -51.000000)" fill="#FFFFFF">
<g id="头部可替换模块" transform="translate(0.000000, -0.000000)">
<g id="headphones" transform="translate(343.000000, 49.000000)">
<path d="M15.8333333,16.6666667 C15.8333333,17.1266667 15.4608333,17.5 15,17.5 C14.5391667,17.5 14.1666667,17.1266667 14.1666667,16.6666667 C14.1666667,14.3691667 12.2975,12.5 10,12.5 C7.7025,12.5 5.83333333,14.3691667 5.83333333,16.6666667 C5.83333333,17.1266667 5.46083333,17.5 5,17.5 C4.53916667,17.5 4.16666667,17.1266667 4.16666667,16.6666667 C4.16666667,13.45 6.78416667,10.8333333 10,10.8333333 C13.2158333,10.8333333 15.8333333,13.45 15.8333333,16.6666667 M10,4.16666667 C10.9191667,4.16666667 11.6666667,4.91416667 11.6666667,5.83333333 C11.6666667,6.7525 10.9191667,7.5 10,7.5 C9.08083333,7.5 8.33333333,6.7525 8.33333333,5.83333333 C8.33333333,4.91416667 9.08083333,4.16666667 10,4.16666667 M10,9.16666667 C11.8383333,9.16666667 13.3333333,7.67166667 13.3333333,5.83333333 C13.3333333,3.995 11.8383333,2.5 10,2.5 C8.16166667,2.5 6.66666667,3.995 6.66666667,5.83333333 C6.66666667,7.67166667 8.16166667,9.16666667 10,9.16666667" id="🎨-Icon-Сolor"></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="18px" viewBox="0 0 16 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>headphones</title>
<defs>
<path d="M15.8333333,15.8333333 C15.8333333,16.2933333 15.4591667,16.6666667 15,16.6666667 L5,16.6666667 C4.54083333,16.6666667 4.16666667,16.2933333 4.16666667,15.8333333 L4.16666667,6.66666667 C4.16666667,6.20666667 4.54083333,5.83333333 5,5.83333333 L5,6.66666667 C5,7.58583333 5.7475,8.33333333 6.66666667,8.33333333 L13.3333333,8.33333333 C14.2525,8.33333333 15,7.58583333 15,6.66666667 L15,5.83333333 C15.4591667,5.83333333 15.8333333,6.20666667 15.8333333,6.66666667 L15.8333333,15.8333333 Z M6.66666667,3.33333333 L13.3333333,3.33583333 L13.3333333,4.16666667 L13.3333333,6.66666667 L6.66666667,6.66666667 L6.66666667,4.16666667 L6.66666667,3.33333333 Z M15,4.16666667 L15,3.33333333 C15,2.41416667 14.2525,1.66666667 13.3333333,1.66666667 L6.66666667,1.66666667 C5.7475,1.66666667 5,2.41416667 5,3.33333333 L5,4.16666667 C3.62166667,4.16666667 2.5,5.28833333 2.5,6.66666667 L2.5,15.8333333 C2.5,17.2116667 3.62166667,18.3333333 5,18.3333333 L15,18.3333333 C16.3783333,18.3333333 17.5,17.2116667 17.5,15.8333333 L17.5,6.66666667 C17.5,5.28833333 16.3783333,4.16666667 15,4.16666667 L15,4.16666667 Z" id="path-1"></path>
</defs>
<g id="😀设计稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="B.1.1-渠道商城-首页--白色" transform="translate(-305.000000, -50.000000)">
<g id="头部可替换模块" transform="translate(0.000000, -0.000000)">
<g id="headphones" transform="translate(303.000000, 49.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="🎨-Icon-Сolor" fill="#303133" xlink:href="#path-1"></use>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="18px" viewBox="0 0 16 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>headphones</title>
<defs>
<path d="M15.8333333,15.8333333 C15.8333333,16.2933333 15.4591667,16.6666667 15,16.6666667 L5,16.6666667 C4.54083333,16.6666667 4.16666667,16.2933333 4.16666667,15.8333333 L4.16666667,6.66666667 C4.16666667,6.20666667 4.54083333,5.83333333 5,5.83333333 L5,6.66666667 C5,7.58583333 5.7475,8.33333333 6.66666667,8.33333333 L13.3333333,8.33333333 C14.2525,8.33333333 15,7.58583333 15,6.66666667 L15,5.83333333 C15.4591667,5.83333333 15.8333333,6.20666667 15.8333333,6.66666667 L15.8333333,15.8333333 Z M6.66666667,3.33333333 L13.3333333,3.33583333 L13.3333333,4.16666667 L13.3333333,6.66666667 L6.66666667,6.66666667 L6.66666667,4.16666667 L6.66666667,3.33333333 Z M15,4.16666667 L15,3.33333333 C15,2.41416667 14.2525,1.66666667 13.3333333,1.66666667 L6.66666667,1.66666667 C5.7475,1.66666667 5,2.41416667 5,3.33333333 L5,4.16666667 C3.62166667,4.16666667 2.5,5.28833333 2.5,6.66666667 L2.5,15.8333333 C2.5,17.2116667 3.62166667,18.3333333 5,18.3333333 L15,18.3333333 C16.3783333,18.3333333 17.5,17.2116667 17.5,15.8333333 L17.5,6.66666667 C17.5,5.28833333 16.3783333,4.16666667 15,4.16666667 L15,4.16666667 Z" id="path-1"></path>
</defs>
<g id="😀设计稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="B.1.1-渠道商城-首页-有颜色" transform="translate(-313.000000, -50.000000)">
<g id="头部可替换模块" transform="translate(0.000000, -0.000000)">
<g id="headphones" transform="translate(311.000000, 49.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="🎨-Icon-Сolor" fill="#FFFFFF" xlink:href="#path-1"></use>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#606266" d="M511.712 187.008c-159.328 0-304.512 70.176-415.712 170.496l65.152 75.136c93.888-84.384 216.256-135.84 350.56-135.84 134.496 0 257.088 51.648 351.072 136.256L928 358.016C816.704 257.376 671.328 187.008 511.712 187.008zM232 514.368l68.928 79.52c56.768-50.048 130.304-80.416 210.784-80.416 80.64 0 154.24 30.464 211.072 80.672l69.024-79.392c-75.136-67.2-172.896-111.072-280.096-111.072C404.704 403.68 307.072 447.424 232 514.368zM369.888 673.408l141.824 163.584 142.016-163.424c-38.464-33.216-87.936-56.224-142.016-56.224C457.728 617.344 408.288 640.32 369.888 673.408z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#606266" d="M160 704l128 0 0 128-128 0 0-128Z" /><path fill="#606266" d="M352 576l128 0 0 256-128 0 0-256Z" /><path fill="#606266" d="M544 384l128 0 0 448-128 0 0-448Z" /><path fill="#606266" d="M736 192l128 0 0 640-128 0 0-640Z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M160 704l128 0 0 128-128 0 0-128Z" /><path fill="#ffffff" d="M352 576l128 0 0 256-128 0 0-256Z" /><path fill="#ffffff" d="M544 384l128 0 0 448-128 0 0-448Z" /><path fill="#ffffff" d="M736 192l128 0 0 640-128 0 0-640Z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M511.712 187.008c-159.328 0-304.512 70.176-415.712 170.496l65.152 75.136c93.888-84.384 216.256-135.84 350.56-135.84 134.496 0 257.088 51.648 351.072 136.256L928 358.016C816.704 257.376 671.328 187.008 511.712 187.008zM232 514.368l68.928 79.52c56.768-50.048 130.304-80.416 210.784-80.416 80.64 0 154.24 30.464 211.072 80.672l69.024-79.392c-75.136-67.2-172.896-111.072-280.096-111.072C404.704 403.68 307.072 447.424 232 514.368zM369.888 673.408l141.824 163.584 142.016-163.424c-38.464-33.216-87.936-56.224-142.016-56.224C457.728 617.344 408.288 640.32 369.888 673.408z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="32px" height="32.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#3877FF" d="M515.072 222.208c-112.128 0-203.776 91.136-203.776 203.264 0 112.128 91.136 203.776 203.776 203.776 112.128 0 203.776-91.136 203.776-203.776-0.512-111.616-91.648-203.264-203.776-203.264z m0 354.816c-83.456 0-151.552-68.096-151.552-151.552s68.096-151.04 151.552-151.04 151.552 68.096 151.552 151.04c-0.512 83.968-68.096 151.552-151.552 151.552zM833.536 560.128c17.92-42.496 27.136-88.064 27.136-134.656 0-46.592-9.216-91.648-27.136-134.656-17.408-40.96-42.496-78.336-74.24-109.568-31.744-31.744-68.608-56.832-109.568-74.24-42.496-17.92-88.064-27.136-134.656-27.136-46.592 0-91.648 9.216-134.656 27.136-40.96 17.408-78.336 42.496-109.568 74.24-31.744 31.744-56.832 68.608-74.24 109.568-17.92 42.496-27.136 88.064-27.136 134.656 0 46.592 9.216 91.648 27.136 134.656 17.408 40.96 42.496 78.336 74.24 109.568 4.096 4.096 8.704 8.192 12.8 12.288l-80.896 143.872c-6.144 11.264-5.632 25.088 2.048 35.84 7.68 10.752 20.48 15.36 33.28 13.312l75.776-14.848 40.448 68.608c6.144 10.24 16.896 16.384 28.672 16.384h0.512c11.776 0 22.528-6.656 28.672-16.896l88.576-157.184c5.12 0 10.24 0.512 15.36 0.512 10.24 0 20.48-0.512 30.72-1.536l71.68 156.16c5.12 11.264 16.384 18.432 28.672 18.944h1.536c11.776 0 22.528-6.144 28.672-16.384l40.448-68.608 75.776 14.848c12.8 2.56 25.6-2.56 33.28-13.312s8.192-24.576 2.048-35.84l-80.896-143.872c4.608-4.096 8.704-8.192 12.8-12.288 30.208-31.232 54.784-68.096 72.704-109.568z m-457.216 316.416l-27.136-46.592c-8.192-14.336-25.088-22.016-41.472-18.944l-33.28 6.656 49.664-88.064c16.384 9.728 33.28 18.432 51.2 26.112 18.944 8.192 38.4 14.336 58.368 19.456l-57.344 101.376z m374.272-61.952l-32.256-6.144c-15.872-3.072-31.744 4.096-39.936 17.92l-22.528 38.912-44.032-95.232c13.824-4.096 28.16-9.216 41.472-14.848 16.896-7.168 33.28-15.36 49.152-25.088l48.128 84.48z m-26.112-179.2c-55.808 55.808-130.56 87.04-209.408 87.04-79.36 0-153.6-30.72-209.408-87.04-55.808-55.808-87.04-130.56-87.04-209.408 0-79.36 30.72-153.6 87.04-209.408 55.808-55.808 130.56-87.04 209.408-87.04 79.36 0 153.6 30.72 209.408 87.04 55.808 55.808 87.04 130.56 87.04 209.408 0 78.848-30.72 153.6-87.04 209.408z" /></svg>
\ No newline at end of file
import React, { useState, useEffect } from 'react'
import { history } from 'umi';
import { LayoutOutlined, EyeOutlined, PushpinOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { message } from 'antd'
import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal'
import { PublicApi } from '@/services/api'
......@@ -56,15 +56,27 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const handleLinkEdit = () => {
window.location.href = `/memberCenter/channelAbility/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
// history.push(`/channel/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`)
if(detailInfo?.environment === 1) {
// web店铺装修
window.location.href = `/memberCenter/channelAbility/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
} else if(detailInfo?.environment === 4) {
// app店铺装修
window.location.href = `/memberCenter/channelAbility/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
} else {
message.info("暂不支持该类型模板装修")
}
}
const handleLinkPreview = () => {
window.location.href = `/memberCenter/channelAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
if(detailInfo?.environment === 1) {
window.location.href = `/memberCenter/channelAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
} else if(detailInfo?.environment === 4) {
window.location.href = `/memberCenter/channelAbility/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
} else {
message.info("暂不支持该类型模板预览")
}
}
return (
<DetailPage
title="查看模板"
......
......@@ -5,6 +5,7 @@ import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel'
import config from '../configs'
import { LAYOUT_TYPE } from '@/constants'
import { GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateApi'
import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, CommonTitle1Config, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, AboutUsConfig, InformationConfig, FooterConfig } from './defaultData'
import Loading from '../components/Loading'
import { menuData } from './defaultMenu'
......@@ -119,7 +120,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
/**
* 获取渠道信息
*/
const fetchShopInfo = () => {
const fetchShopInfo = (): Promise<GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse> => {
return new Promise((resolve) => {
const params: any = {
memberId: userInfo.memberId
......
/*
* @Author: ghua
* @Date: 2021-01-28 10:32:29
* @LastEditTime: 2021-02-26 10:26:02
* @LastEditors: Please set LastEditors
* @Description: 移动端装修面板
* @FilePath: /lingxi-business-paltform/src/pages/editor/components/MobileDesignPanel.tsx
*/
import React from 'react'
import { BrickDesign } from 'lingxi-design'
import MobileUIDemo from './mobileUIDemo'
......@@ -9,8 +17,8 @@ const MobileDesignPanel = (props) => {
return (
<div className={styles.mobileDesignContainer}>
<div className={styles.mobileDesignWrap}>
<BrickDesign theme={theme} mobile />
{/* <MobileUIDemo /> */}
{/* <BrickDesign theme={theme} mobile /> */}
<MobileUIDemo />
</div>
<div className={styles.appBottom}>
<div className={styles.appBottomStrip}></div>
......
......@@ -6,6 +6,12 @@
margin-top: 0;
}
.channel_quick_nav {
padding-top: 12px;
margin: 0 8px;
border-radius: 8px;
}
.mall_latyout {
width: 100%;
min-height: 100%;
......
/*
* @Author: ghua
* @Date: 2021-02-26 11:00:24
* @LastEditTime: 2021-02-26 11:01:23
* @LastEditors: Please set LastEditors
* @Description: app渠道商城头部组件
* @FilePath: /lingxi-business-paltform/src/pages/editor/configs/componentConfigs/LingXiUI/MobileChannelHeaderNav.ts
*/
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const MobileChannelHeaderNav: ComponentConfigTypes = {
propsConfig: {
componentType: {
label: '编辑',
type: PROPS_TYPES.mobileShopHeaderNav
},
},
};
export default MobileChannelHeaderNav;
/*
* @Author: ghua
* @Date: 2021-01-28 10:32:29
* @LastEditTime: 2021-02-26 11:03:42
* @LastEditors: Please set LastEditors
* @Description: 瓴犀装修组件配置集合
* @FilePath: /lingxi-business-paltform/src/pages/editor/configs/componentConfigs/LingXiUI/index.ts
*/
import TopBar from './TopBar'
import Header from './Header';
import Navigation from './Navigation'
......@@ -20,6 +28,7 @@ import MobileBanner from './MobileBanner'
import MobileQuickNav from './MobileQuickNav'
import MobileShopCommodityList from './MobileShopCommodityList'
import MobileShopHeaderNav from './MobileShopHeaderNav'
import MobileChannelHeaderNav from './MobileChannelHeaderNav'
export default {
TopBar,
......@@ -41,6 +50,7 @@ export default {
MobileQuickNav,
MobileShopCommodityList,
MobileShopHeaderNav,
MobileChannelHeaderNav,
...FloorLine,
...ShopFloorLine,
...ShowCase
......
/*
* @Author: ghua
* @Date: 2020-08-25 15:00:53
* @LastEditTime: 2021-02-26 16:29:25
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: /lingxi-business-paltform/src/pages/editor/configs/index.ts
*/
import { htmlContainers, htmlNonContainers } from './htmlCategory';
import { reactContainers, reactNonContainers } from './reactCategory';
// import * as Ants from 'antd/es';
import * as LingXiUI from 'lingxi-design-ui'
import * as CustomComponents from '../customComponents'
import AllComponentConfigs from './componentConfigs';
import { CategoryType, ConfigType } from 'lingxi-editor-core';
import { flattenDeepArray } from '../utils';
import { message } from 'antd';
const originalComponents = { ...LingXiUI }
const originalComponents = { ...LingXiUI, ...CustomComponents }
/**
* 容器组件分类
......
@import '../style/common.less';
.@{prefixCls}-goods-card {
position: relative;
.@{prefixCls}-goods-list {
position: relative;
padding: 0 8px;
&-item {
background-color: #FFF;
margin-top: 12px;
border-radius: 8px;
overflow: hidden;
&-title {
display: flex;
padding: 10px 12px;
background: linear-gradient(135deg, #F6DDB7 0%, #F6E4CF 100%);
align-items: center;
&-left {
flex: 1;
&-title {
color: #3D4263;
font-size: 16px;
font-weight: 500;
line-height: 18px;
}
&-vicetitle {
display: block;
color: #3D4263;
font-size: 14px;
margin-top: 10px;
line-height: 14px;
}
}
}
&-more {
width: 60px;
height: 24px;
background-color: rgba(61, 66, 99, 0.1);
color: #3D4263;
font-size: 12px;
text-align: center;
line-height: 24px;
border-radius: 13px;
}
&-main {
.@{prefixCls}-price-wrap {
flex: 1;
font-size: 12px;
color: #909399;
&>.price {
font-size: 16px;
color: #D32F2F;
font-weight: 500;
margin-right: 2px;
}
}
&-recommend {
display: flex;
border-bottom: 1px solid #EEF0F3;
padding: 8px 12px;
&-info {
flex: 1;
width: 0;
display: flex;
flex-direction: column;
margin-left: 12px;
&-name {
color: #303133;
font-size: 14px;
font-weight: 500;
line-height: 20px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
&-tag {
height: 24px;
width: 57px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 6px;
background-color: #F0F7FF;
margin-top: 8px;
color: #3877FF;
&-icon {
position: relative;
margin-right: 3px;
width: 16px;
height: 16px;
}
}
&-bottom {
margin-top: auto;
font-size: 12px;
color: #909399;
display: flex;
align-items: flex-end;
}
}
}
&-scrollview {
width: 100%;
padding-bottom: 4px;
overflow-x: auto;
&::-webkit-scrollbar {
display: none
}
&-list {
padding-left: 16px;
white-space: nowrap;
&-item {
display: inline-block;
margin-right: 16px;
width: 112px;
padding-bottom: 10px;
&-name {
font-size: 12px;
color: #303133;
margin-top: 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
}
}
}
/*
* @Author: ghua
* @Date: 2021-02-26 14:28:50
* @LastEditTime: 2021-02-26 17:13:13
* @LastEditors: Please set LastEditors
* @Description: app渠道商城商品展示组件
* @FilePath: /lingxi-business-paltform/src/pages/editor/customComponents/ChannelGoodsCard/index.tsx
*/
import React from 'react'
import { ConfigConsumer } from '../Generator'
import cx from 'classnames'
import ImageBox from '@/components/ImageBox'
import youzhiIcon from '@/assets/mobileIcons/youzhi.svg'
import styles from './index.less'
export interface DataItemType {
name: string,
content: string,
status: boolean,
}
interface ChannelGoodsCardPropsType {
className?: string,
/** 样式主题 */
styleTheme?: number,
dataList: DataItemType[],
}
const STYLE_THEME_List = {
0: "default",
1: "science"
}
const ChannelGoodsCard: React.FC<ChannelGoodsCardPropsType> = (props) => {
const { children, className, styleTheme, dataList, ...others } = props
const renderChildren = ({ getPrefixCls }: any) => {
const prefixCls = getPrefixCls("goods-card");
const classNameString = cx(styles[`${prefixCls}`], styles[STYLE_THEME_List[styleTheme]], className)
return (
<div className={classNameString} {...others}>
<div className={styles["lingxi-goods-list"]}>
<div className={styles["lingxi-goods-list-item"]}>
<div className={styles["lingxi-goods-list-item-title"]}>
<div className={styles["lingxi-goods-list-item-title-left"]}>
<div className={styles["lingxi-goods-list-item-title-left-title"]}>电气电工</div>
<label className={styles["lingxi-goods-list-item-title-left-vicetitle"]}>ELECTRICAL</label>
</div>
<div className={styles["lingxi-goods-list-item-more"]}>
<span>更多 &gt;</span>
</div>
</div>
<div className={styles["lingxi-goods-list-item-main"]}>
<div className={styles["lingxi-goods-list-item-main-recommend"]}>
<ImageBox
imgUrl="https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/19466a6f8a5448c5b1a2011f642126611610677625949.png"
width={104}
height={104}
/>
<div className={styles["lingxi-goods-list-item-main-recommend-info"]}>
<div className={styles["lingxi-goods-list-item-main-recommend-info-name"]}>三级抗震螺纹钢 HRB400E 25*12三抗震螺纹钢</div>
<div className={styles["lingxi-goods-list-item-main-recommend-info-tag"]}>
<img className={styles["lingxi-goods-list-item-main-recommend-info-tag-icon"]} src={youzhiIcon} />
<span>推荐</span>
</div>
<div className={styles["lingxi-goods-list-item-main-recommend-info-bottom"]}>
<div className={styles["lingxi-price-wrap"]}>
<span className={styles.price}>¥79.00</span>
<span className={styles.unit}>/吨</span>
</div>
<div className={styles["lingxi-goods-list-item-main-recommend-info-bottom-sold"]}>3133成交</div>
</div>
</div>
</div>
<div className={styles["lingxi-goods-list-item-main-scrollview"]}>
<div className={styles["lingxi-goods-list-item-main-scrollview-list"]}>
<div className={styles["lingxi-goods-list-item-main-scrollview-list-item"]}>
<ImageBox
imgUrl="https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/19466a6f8a5448c5b1a2011f642126611610677625949.png"
width={112}
height={112}
/>
<div className={styles["lingxi-goods-list-item-main-scrollview-list-item-name"]}>黑色手折纹胎水色黑色手折纹胎水色</div>
<div className={styles["lingxi-price-wrap"]}>
<span className={styles.price}>¥79.00</span>
<span className={styles.unit}>/吨</span>
</div>
</div>
<div className={styles["lingxi-goods-list-item-main-scrollview-list-item"]}>
<ImageBox
imgUrl="https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/19466a6f8a5448c5b1a2011f642126611610677625949.png"
width={112}
height={112}
/>
<div className={styles["lingxi-goods-list-item-main-scrollview-list-item-name"]}>黑色手折纹胎水色黑色手折纹胎水色</div>
<div className={styles["lingxi-price-wrap"]}>
<span className={styles.price}>¥79.00</span>
<span className={styles.unit}>/吨</span>
</div>
</div>
<div className={styles["lingxi-goods-list-item-main-scrollview-list-item"]}>
<ImageBox
imgUrl="https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/19466a6f8a5448c5b1a2011f642126611610677625949.png"
width={112}
height={112}
/>
<div className={styles["lingxi-goods-list-item-main-scrollview-list-item-name"]}>黑色手折纹胎水色黑色手折纹胎水色</div>
<div className={styles["lingxi-price-wrap"]}>
<span className={styles.price}>¥79.00</span>
<span className={styles.unit}>/吨</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
)
}
return <ConfigConsumer>{renderChildren}</ConfigConsumer>
}
export default ChannelGoodsCard
@import '../style/common.less';
.@{prefixCls}-header-nav {
position: relative;
// 默认样式
&.default {
background-color: @headerNavDefaultColor;
color: #303133;
.@{prefixCls}-status-bar {
background-color: @headerNavDefaultColor;
}
.@{prefixCls}-header-search {
&-body {
background-color: #F7F8FA;
}
}
.@{prefixCls}-header-category {
&-item {
color: #606266;
&.active {
color: #D32F2F;
}
}
&-icon {
color: #606266;
}
}
}
// 科技类样式
&.science {
background-color: @headerNavScienceColor;
color: #FFF;
.@{prefixCls}-status-bar {
background-color: @headerNavScienceColor;
}
.@{prefixCls}-header-bg {
&::after {
background-color: @headerNavScienceColor;
}
}
.@{prefixCls}-header-category {
&-icon {
color: #FFF;
}
}
}
.@{prefixCls}-status-bar {
position: relative;
display: flex;
align-items: center;
height: 44px;
padding: 0 20px;
&-time {
font-size: 15px;
width: 54px;
text-align: center;
}
&-right {
margin-left: auto;
font-size: 20px;
&-icon {
margin-left: 8px;
width: 20px;
height: 20px;
}
}
}
.@{prefixCls}-header {
display: flex;
padding: 0 12px;
&-logoWrap {
padding-top: 6px;
&-logo {
width: 23px;
height: 23px;
margin-right: 4px;
}
&-shopName {
font-weight: 500;
font-size: 14px;
}
}
&-actions {
margin-left: auto;
display: flex;
&-item {
margin-left: 16px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&-icon {
width: 20px;
height: 20px;
border: none;
outline: none;
}
&-text {
font-size: 8px;
margin-top: 2px;
}
}
}
}
.@{prefixCls}-header-search {
padding: 6px 12px;
&-body {
background-color: #FFF;
border-radius: 18px;
height: 28px;
padding: 0 10px;
display: flex;
align-items: center;
}
&-icon {
font-size: 20px;
color: #909399;
margin-right: 10px;
}
&-keyword {
font-size: 14px;
color: #909399;
margin-right: 8px;
}
}
.@{prefixCls}-header-category {
display: flex;
padding-right: 12px;
align-items: center;
height: 40px;
&-main {
display: flex;
flex: 1;
align-items: center;
}
&-item {
font-size: 14px;
padding: 0 12px;
color: rgba(255, 255, 255, 0.6);
font-weight: bold;
&.active {
color: #FFF;
}
}
&-icon {
font-size: 20px;
width: 20px;
height: 20px;
}
}
.@{prefixCls}-header-bg {
position: relative;
width: 100%;
height: 50px;
background: #F7F8FA;
&::after {
content: "";
position: absolute;
width: 120%;
height: 50px;
left: -10%; //椭圆左边隐藏10%,右边隐藏10%
top: 0;
border-radius: 0 0 50% 50%; //左上角,右上角,右下角,左下角
}
}
}
import React, { useState, useEffect } from 'react'
import { ConfigConsumer } from '../Generator'
import { SearchOutlined } from '@ant-design/icons'
import cx from 'classnames'
import styles from './index.less'
import xinhaofullIconDefault from '@/assets/mobileIcons/xinhao_full_default.svg'
import xinhaofullIconScience from '@/assets/mobileIcons/xinhao_full_science.svg'
import xinhaoIconDefault from '@/assets/mobileIcons/xinhao_default.svg'
import xinhaoIconScience from '@/assets/mobileIcons/xinhao_science.svg'
import dianliangIconDefault from '@/assets/mobileIcons/dianliang_default.svg'
import dianliangIconScience from '@/assets/mobileIcons/dianliang_science.svg'
import barChartLineIconDefault from '@/assets/mobileIcons/bar_chart_line_default.svg'
import barChartLineIconScience from '@/assets/mobileIcons/bar_chart_line_science.svg'
import mineIconDefault from '@/assets/mobileIcons/mine_default.svg'
import mineIconScience from '@/assets/mobileIcons/mine_science.svg'
import purchaseOrderIconDefault from '@/assets/mobileIcons/purchaseorder_default.svg'
import purchaseOrderIconScience from '@/assets/mobileIcons/purchaseorder_science.svg'
export interface DataItemType {
name: string,
content: string,
status: boolean,
}
export interface CategoryItemType {
value: number,
label: string,
}
export enum STYLE_THEME {
/** 默认顶部导航样式 */
default = "default",
/** 科技类顶部导航样式 */
science = "science"
}
export interface MobileHeaderNavPropsType {
className?: string,
/** 样式主题 */
styleTheme?: number,
stylesThemeList?: any[],
dataList?: DataItemType[],
}
const STYLE_THEME_List = {
0: "default",
1: "science"
}
const MobileChannelHeaderNav: React.FC<MobileHeaderNavPropsType> = (props) => {
const { children, className, styleTheme, dataList, ...others } = props
const [searchPlaceHolder, setSearchPlaceHolder] = useState<string>('')
useEffect(() => {
const searchInfo: DataItemType | undefined = dataList ? dataList.filter(item => item.name === "搜索框")[0] : undefined
setSearchPlaceHolder(searchInfo ? searchInfo.content : "")
}, [dataList])
const renderChildren = ({ getPrefixCls }: any) => {
const prefixCls = getPrefixCls("header-nav");
const classNameString = cx(styles[`${prefixCls}`], styles[STYLE_THEME_List[styleTheme]], className)
const getIconUrl = (key: string) => {
switch (key) {
case "icon-xinhao-full":
switch(STYLE_THEME_List[styleTheme]) {
case STYLE_THEME.default:
return xinhaofullIconDefault
case STYLE_THEME.science:
return xinhaofullIconScience
default:
return ""
}
case "icon-xinhao":
switch(STYLE_THEME_List[styleTheme]) {
case STYLE_THEME.default:
return xinhaoIconDefault
case STYLE_THEME.science:
return xinhaoIconScience
default:
return ""
}
case "icon-dianliang":
switch(STYLE_THEME_List[styleTheme]) {
case STYLE_THEME.default:
return dianliangIconDefault
case STYLE_THEME.science:
return dianliangIconScience
default:
return ""
}
case "icon-bar-chart-line":
switch(STYLE_THEME_List[styleTheme]) {
case STYLE_THEME.default:
return barChartLineIconDefault
case STYLE_THEME.science:
return barChartLineIconScience
default:
return ""
}
case "进货单":
switch(STYLE_THEME_List[styleTheme]) {
case STYLE_THEME.default:
return purchaseOrderIconDefault
case STYLE_THEME.science:
return purchaseOrderIconScience
default:
return ""
}
case "我的":
switch(STYLE_THEME_List[styleTheme]) {
case STYLE_THEME.default:
return mineIconDefault
case STYLE_THEME.science:
return mineIconScience
default:
return ""
}
default:
return ""
}
}
return (
<div className={classNameString} {...others}>
<div className={styles["lingxi-status-bar"]}>
<span className={styles["lingxi-status-bar-time"]}>9:41</span>
<div className={styles["lingxi-status-bar-right"]}>
<img className={styles["lingxi-status-bar-right-icon"]} src={getIconUrl("icon-xinhao-full")} />
<img className={styles["lingxi-status-bar-right-icon"]} src={getIconUrl("icon-xinhao")} />
<img className={styles["lingxi-status-bar-right-icon"]} src={getIconUrl("icon-dianliang")} />
</div>
</div>
<div className={styles["lingxi-header"]}>
<div className={styles["lingxi-header-logoWrap"]}>
<span className={styles["lingxi-header-logoWrap-shopName"]}>广东美政建材股份有限公司</span>
</div>
<div className={styles["lingxi-header-actions"]}>
{
dataList && dataList.map(item => (item.name !== "搜索框" && item.status) && (
<div className={styles["lingxi-header-actions-item"]} key={item.name}>
<img className={styles["lingxi-header-actions-item-icon"]} src={item.content || getIconUrl(item.name)} />
</div>
))
}
</div>
</div>
<div className={styles["lingxi-header-search"]}>
<div className={styles["lingxi-header-search-body"]}>
<SearchOutlined className={styles["lingxi-header-search-icon"]} />
<span className={styles["lingxi-header-search-keyword"]}>{searchPlaceHolder}</span>
</div>
</div>
<div className={styles["lingxi-header-bg"]}></div>
</div>
)
}
return <ConfigConsumer>{renderChildren}</ConfigConsumer>
}
MobileChannelHeaderNav.defaultProps = {
styleTheme: 1,
dataList: [
{
name: "进货单",
content: "",
status: true,
},
{
name: "我的",
content: "",
status: true,
},
{
name: "搜索框",
content: "请输入商品名称或者品类",
status: true,
}
],
}
export default MobileChannelHeaderNav
@import '../style/common.less';
.@{prefixCls}-channel-information {
position: relative;
margin-top: 12px;
&-title {
font-size: 16px;
color: #303133;
font-weight: 500;
padding: 12px;
line-height: 16px;
}
&-scrollview {
overflow-x: auto;
&::-webkit-scrollbar {
display: none
}
}
&-list {
padding-left: 8px;
white-space: nowrap;
&-item {
width: 280px;
border-radius: 8px;
overflow: hidden;
margin-right: 12px;
display: inline-block;
background-color: #FFF;
&-main {
padding: 12px;
&-title {
color: #303133;
font-size: 14px;
line-height: 20px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
}
}
/*
* @Author: ghua
* @Date: 2021-02-26 17:18:57
* @LastEditTime: 2021-02-26 17:55:12
* @LastEditors: Please set LastEditors
* @Description: app渠道商城行业资讯组件
* @FilePath: /lingxi-business-paltform/src/pages/editor/customComponents/ChannelInformation/index.tsx
*/
import React from 'react'
import { ConfigConsumer } from '../Generator'
import cx from 'classnames'
import ImageBox from '@/components/ImageBox'
import styles from './index.less'
interface MobileChannelInformationPropsType {
className?: string,
}
const MobileChannelInformation: React.FC<MobileChannelInformationPropsType> = (props) => {
const { className, ...others} = props
const renderChildren = ({ getPrefixCls }: any) => {
const prefixCls = getPrefixCls("channel-information");
const classNameString = cx(styles[`${prefixCls}`], className)
return (
<div className={classNameString} {...others}>
<div className={styles["lingxi-channel-information-title"]}>
<span>行业资讯</span>
</div>
<div className={styles["lingxi-channel-information-scrollview"]}>
<div className={styles["lingxi-channel-information-list"]}>
<div className={styles["lingxi-channel-information-list-item"]}>
<ImageBox
width={280}
height={186}
imgUrl="https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/67ddeff87f6140069813dc59ae08cf4d1611738206717.jpg_430x430q90"
/>
<div className={styles["lingxi-channel-information-list-item-main"]}>
<div className={styles["lingxi-channel-information-list-item-main-title"]}>B2B供应链电商系统平台解决案,如何实现全网整合B2B供应链</div>
</div>
</div>
<div className={styles["lingxi-channel-information-list-item"]}>
<ImageBox
width={280}
height={186}
imgUrl="https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/67ddeff87f6140069813dc59ae08cf4d1611738206717.jpg_430x430q90"
/>
</div>
</div>
</div>
</div>
)
}
return <ConfigConsumer>{renderChildren}</ConfigConsumer>
}
export default MobileChannelInformation
import * as React from 'react';
export const ConfigContext = React.createContext<any>({
getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `lingxi-${suffixCls}` : 'lingxi';
},
});
export const ConfigConsumer = ConfigContext.Consumer;
export interface BasicProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;
}
export interface GeneratorProps {
suffixCls: string;
tagName: 'section' | 'nav' | 'div' | 'span';
displayName: string;
}
export const Generator = ({ suffixCls, tagName, displayName }: GeneratorProps) => {
return (BasicComponent: any) => {
return class Adapter extends React.Component<BasicProps, any> {
static displayName: string = displayName;
renderComponent = ({ getPrefixCls }: any) => {
const { prefixCls: customizePrefixCls } = this.props;
const prefixCls = getPrefixCls(suffixCls, customizePrefixCls);
return <BasicComponent prefixCls={prefixCls} tagName={tagName} {...this.props} />;
};
render() {
return <ConfigConsumer>{this.renderComponent}</ConfigConsumer>;
}
};
};
}
/*
* @Author: ghua
* @Date: 2021-02-26 16:25:44
* @LastEditTime: 2021-02-26 16:27:08
* @LastEditors: Please set LastEditors
* @Description: 自定义组件
* @FilePath: /lingxi-business-paltform/src/pages/editor/customComponents/index.ts
*/
export { default as MobileChannelHeaderNav } from './ChannelHeaderNav'
export { default as MobileChannelGoodsCard } from './ChannelGoodsCard'
@prefixCls: lingxi;
@headerNavDefaultColor: #FFF;
@headerNavScienceColor: #D32F2F;
......@@ -67,6 +67,7 @@ const PayWay: React.FC<PayWayProps> = (props) => {
result = false
}
} else if(info.payType === 4) {
// 判断如果是货到付款的方式,若物流方式不是物流配送,则不支持货到付款
if(deliveryType !== 1) {
result = false
} else {
......
/*
* @Author: your name
* @Date: 2021-02-22 17:02:20
* @LastEditTime: 2021-02-22 17:02:21
* @LastEditTime: 2021-02-26 11:04:18
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /lingxi-business-paltform/src/pages/mobileTemplate/channelTemplateEdit/config.ts
......@@ -25,10 +25,10 @@ export const mallLayoutConfig = {
},
}
export const mobileShopHeaderNav = {
export const mobileChannelHeaderNav = {
key: "1",
"1": {
"componentName": "MobileShopHeaderNav",
"componentName": "MobileChannelHeaderNav",
"componentType": PROPS_TYPES.mobileShopHeaderNav,
"title": "背景图编辑",
"canEdit": true,
......
/*
* @Author: your name
* @Author: ghua
* @Date: 2021-02-22 17:02:20
* @LastEditTime: 2021-02-22 17:02:20
* @LastEditors: your name
* @Description: In User Settings Edit
* @LastEditTime: 2021-02-26 11:04:34
* @LastEditors: Please set LastEditors
* @Description: app渠道商城装修
* @FilePath: /lingxi-business-paltform/src/pages/mobileTemplate/channelTemplateEdit/index.tsx
*/
/*
* @Author: ghua
* @Date: 2021-01-14 17:03:08
* @Last Modified by: ghua
* @Last Modified time: 2021-01-15 17:47:38
* @Description 店铺主页装修
*/
import React, { useEffect, useState } from 'react'
import { LegoProvider } from 'lingxi-editor-core'
import ToolBar from '../../editor/components/toolBar'
......@@ -24,7 +16,7 @@ import config from '../../editor/configs'
import {
mallLayoutConfig,
divWrap,
mobileShopHeaderNav,
mobileChannelHeaderNav,
mobileBanner,
mobileQuickNav,
mobileShopCommodityList,
......@@ -33,7 +25,7 @@ import {
import Loading from '../../editor/components/Loading'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { GetTemplateAdornAppStoreFindResponse, GetTemplateWebMemberShopWebFindByMemberIdAndRoleIdResponse } from '@/services/TemplateApi'
import { GetTemplateAdornAppStoreFindResponse, GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateApi'
// import { GlobalConfig } from '@/global/config'
import MobileSettingPanel from '../../editor/mobileSettingPanel'
import { getAuth } from '@/utils/auth'
......@@ -73,19 +65,16 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
}, [])
/**
* 获取店铺信息
* 获取渠道信息
*/
const fetchShopInfo = (): Promise<GetTemplateWebMemberShopWebFindByMemberIdAndRoleIdResponse> => {
const fetchChannelInfo = (): Promise<GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse> => {
return new Promise((resolve) => {
const param: any = {
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateWebMemberShopWebFindByMemberIdAndRoleId(param).then(res => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel(param).then(res => {
if (res.code === 1000) {
if (res.code === 1000) {
resolve(res.data)
}
resolve(res.data)
}
})
})
......@@ -111,36 +100,6 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
})
}
const getRecommendShopList = (param) => {
return new Promise((resolve, reject) => {
PublicApi.getTemplateWebMemberShopWebRecommendList(param).then(res => {
if(res.code === 1000) {
resolve(res.data.data)
} else {
reject(false)
}
}).catch((eror) => {
reject(false)
})
})
}
const getStoreBOList = (dataList) => {
if(dataList) {
const res = dataList.map(item => {
item.selectId = item.id
item.name = item.memberName
item.selectInfo = Object.assign({}, item)
return item
})
return res
} else {
return []
}
}
/**
* 根据选中的类型和id获取信息
* @param data
......@@ -182,20 +141,6 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
}
const getExcellentDetailsBO = async (dataList) => {
if(dataList) {
const newRes: any = []
for(const item of dataList) {
const temp = { ...item }
temp.recommendList = await getSelectInfo(item)
newRes.push(temp)
}
console.log(newRes, 'newRes')
return newRes
} else {
return []
}
}
const changeData = (dataList) => {
if(dataList) {
......@@ -248,12 +193,12 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const appConfig = await getAppShopConfig()
console.log(appConfig, "appConfig")
//店铺信息
const shopInfo = await fetchShopInfo()
mobileShopHeaderNav[mobileShopHeaderNav.key].props.shopInfo = shopInfo
//渠道信息
const shopInfo = await fetchChannelInfo()
mobileChannelHeaderNav[mobileChannelHeaderNav.key].props.shopInfo = shopInfo
if(appConfig?.backdropBO) {
mobileShopHeaderNav[mobileShopHeaderNav.key].props.backdrop = appConfig?.backdropBO.backdrop
mobileChannelHeaderNav[mobileChannelHeaderNav.key].props.backdrop = appConfig?.backdropBO.backdrop
}
if(appConfig?.advertBO) {
......@@ -279,7 +224,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const config = {
...mallLayoutConfig,
...mobileShopHeaderNav,
...mobileChannelHeaderNav,
...divWrap,
...mobileBanner,
...mobileQuickNav,
......@@ -296,7 +241,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
return !loading ? (
<LegoProvider initState={{ componentConfigs: componentConfigs }} config={config}>
<div className={styles['wrapper']}>
<ToolBar type={1} title="店铺主页" showActions={true} layoutType={LAYOUT_TYPE.shop} templateId={id} />
<ToolBar type={1} title="渠道商城-首页" showActions={true} layoutType={LAYOUT_TYPE.shop} templateId={id} />
<div className={styles['content']}>
<AllComponents />
<div className={styles['app-wrapper']}>
......
/*
* @Author: ghua
* @Date: 2021-01-14 17:03:08
* @Last Modified by: ghua
* @Last Modified time: 2021-01-15 17:47:38
* @Description 店铺主页装修
* @Last Modified by: ghua
* @Last Modified time: 2021-01-15 17:47:38
* @Description app店铺主页装修
*/
import React, { useEffect, useState } from 'react'
import { LegoProvider } from 'lingxi-editor-core'
import ToolBar from '../../editor/components/toolBar'
......@@ -20,7 +19,6 @@ import {
mobileBanner,
mobileQuickNav,
mobileShopCommodityList,
} from './config'
import Loading from '../../editor/components/Loading'
import { PublicApi } from '@/services/api'
......@@ -75,9 +73,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
}
PublicApi.getTemplateWebMemberShopWebFindByMemberIdAndRoleId(param).then(res => {
if (res.code === 1000) {
if (res.code === 1000) {
resolve(res.data)
}
resolve(res.data)
}
})
})
......@@ -103,92 +99,6 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
})
}
const getRecommendShopList = (param) => {
return new Promise((resolve, reject) => {
PublicApi.getTemplateWebMemberShopWebRecommendList(param).then(res => {
if(res.code === 1000) {
resolve(res.data.data)
} else {
reject(false)
}
}).catch((eror) => {
reject(false)
})
})
}
const getStoreBOList = (dataList) => {
if(dataList) {
const res = dataList.map(item => {
item.selectId = item.id
item.name = item.memberName
item.selectInfo = Object.assign({}, item)
return item
})
return res
} else {
return []
}
}
/**
* 根据选中的类型和id获取信息
* @param data
*/
const getSelectInfo = (data): Promise<any[] | undefined> => {
return new Promise((resolve) => {
let getFn: any = null
const param: any = {
current: 1,
pageSize: 100,
}
switch(data.type) {
case 1:
param.idInList = data.recommend
getFn = PublicApi.postSearchMobileShopEnterpriseGetCommodityList
break
case 2:
param.idList = data.recommend
getFn = PublicApi.getTemplateWebMemberShopWebRecommendList
break
case 3:
param.idList = data.recommend
getFn = PublicApi.postSearchMobileShopEnterpriseGetCategoryBrand
break
case 4:
param.idList = data.recommend
getFn = PublicApi.getManageContentInformationPageByIdIn
break
default:
break
}
getFn ? getFn(param).then(res => {
message.destroy()
resolve(data.type === 3 ? res.data : res.data.data)
}).catch(() => {
resolve(undefined)
}) : resolve(undefined)
})
}
const getExcellentDetailsBO = async (dataList) => {
if(dataList) {
const newRes: any = []
for(const item of dataList) {
const temp = { ...item }
temp.recommendList = await getSelectInfo(item)
newRes.push(temp)
}
console.log(newRes, 'newRes')
return newRes
} else {
return []
}
}
const changeData = (dataList) => {
if(dataList) {
return dataList.map((dataItem) => {
......@@ -238,7 +148,6 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const getComponentsConfig = async () => {
try {
const appConfig = await getAppShopConfig()
console.log(appConfig, "appConfig")
//店铺信息
const shopInfo = await fetchShopInfo()
......
......@@ -70,7 +70,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const handleLinkPreview = () => {
window.location.href = `/memberCenter/shopAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
if(detailInfo?.environment === 1) {
window.location.href = `/memberCenter/shopAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
} else if(detailInfo?.environment === 4) {
window.location.href = `/memberCenter/shopAbility/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
} else {
message.info("暂不支持该类型模板预览")
}
}
return (
......
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