Commit 8df1e773 authored by GuanHua's avatar GuanHua

fix: app渠道商城装修问题修复

parent 11e921cc
......@@ -6,6 +6,7 @@ import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal'
import { PublicApi } from '@/services/api'
import { Environment_Status } from '@/constants'
import { GlobalConfig } from '@/global/config'
import { GetTemplateWebPageTemplateWebFindChannelTemplateDetailsResponse } from '@/services/TemplateApi'
import styles from './index.less'
......@@ -19,21 +20,28 @@ interface TemplateDetailPropsType {
}
const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const { query: { type, id } } = props.location
const { query: { id } } = props.location
const [detailInfo, setDetailInfo] = useState<GetTemplateWebPageTemplateWebFindChannelTemplateDetailsResponse>()
const [useModalVisible, setUseModalVisible] = useState<boolean>(false)
const [confirmLoading, setConfirmLoading] = useState(false)
const [shopType, setShopType] = useState<number>()
useEffect(() => {
fetchDetail()
}, [])
const getType = (info: GetTemplateWebPageTemplateWebFindChannelTemplateDetailsResponse): number => {
const mallInfo = GlobalConfig.web.shopInfo.filter((item) => item.id === info.shopId)[0]
return mallInfo.type
}
const fetchDetail = () => {
const param: any = {
id
}
PublicApi.getTemplateWebPageTemplateWebFindChannelTemplateDetails(param).then(res => {
if (res.code === 1000) {
setShopType(getType(res.data))
setDetailInfo(res.data)
}
})
......@@ -58,10 +66,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const handleLinkEdit = () => {
if(detailInfo?.environment === 1) {
// web店铺装修
window.location.href = `/memberCenter/channelAbility/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
window.location.href = `/memberCenter/channelAbility/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}`
} else if(detailInfo?.environment === 4) {
// app店铺装修
window.location.href = `/memberCenter/channelAbility/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
window.location.href = `/memberCenter/channelAbility/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}`
} else {
message.info("暂不支持该类型模板装修")
}
......@@ -69,9 +77,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const handleLinkPreview = () => {
if(detailInfo?.environment === 1) {
window.location.href = `/memberCenter/channelAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
window.location.href = `/memberCenter/channelAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}`
} else if(detailInfo?.environment === 4) {
window.location.href = `/memberCenter/channelAbility/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
window.location.href = `/memberCenter/channelAbility/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}`
} else {
message.info("暂不支持该类型模板预览")
}
......
......@@ -20,7 +20,7 @@ const NewTrade: React.FC = () => {
}, [])
const autoPlayList = (maxLenght) => {
const new_trade_list = document.getElementById("new_trade_list")
const new_trade_list: any = document.getElementById("new_trade_list")
if (new_trade_list) {
const autoPlaySpeed = 5000
const unitDistance = 79
......@@ -29,8 +29,6 @@ const NewTrade: React.FC = () => {
timer = setInterval(() => {
distance += unitDistance
if (distance < maxDistance) {
//@ts-ignore
new_trade_list.style = `transform: translateY(${-distance}px);`
} else {
clearInterval(timer)
......@@ -47,16 +45,16 @@ const NewTrade: React.FC = () => {
}, [current])
const fetchData = () => {
let param = {
const param: any = {
current: current,
pageSize: pageSize
}
//@ts-ignore
PublicApi.getOrderProcurementOrderTransactionDynamics(param).then(res => {
if (res.code === 1000) {
let newList = [...list, ...res.data.data]
const newList = [...list, ...res.data.data]
setList(newList)
let maxLenght = newList.length
const maxLenght = newList.length
if (res.data.data && res.data.data.length > 0) {
autoPlayList(maxLenght)
}
......
......@@ -43,6 +43,7 @@ interface ShopPreviewPropsType {
* 模板名称
*/
template: string;
type: number,
}
}
}
......@@ -50,13 +51,14 @@ interface ShopPreviewPropsType {
const TemplateList = ['science']
const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const { query: { id, template } } = props.location
const { query: { id, template, type } } = props.location
const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-mall-science')
const [componentConfigs, setComponentConfigs] = useState({})
const headers = {
environment: "4"
environment: "4",
type: Number(type)
}
useEffect(() => {
......
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