Commit 82899bd1 authored by Bill's avatar Bill

Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev

parents 335fb03d b932ee57
......@@ -9,6 +9,7 @@ import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdver
import Loading from '../components/Loading'
import { menuData } from './defaultMenu'
import { PublicApi } from '@/services/api'
import { getAuth } from '@/utils/auth'
import styles from './index.less'
interface ChannelPreviewPropsType {
......@@ -30,6 +31,7 @@ const TemplateList = ['science']
const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const { query: { id, template } } = props.location
const userInfo = getAuth() || {}
const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-channel-science')
const [componentConfigs, setComponentConfigs] = useState({})
......@@ -47,7 +49,8 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
return new Promise((resolve) => {
const params: any = {
templateId: id,
type: 1
type: 1,
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
......@@ -64,7 +67,8 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
return new Promise((resolve) => {
const params: any = {
templateId: id,
type: 2
type: 2,
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
......@@ -82,7 +86,10 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
*/
const fetchFirstCategory = () => {
return new Promise((resolve) => {
PublicApi.getTemplateChannelFindAllFirstCategory().then(res => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -97,7 +104,8 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
return new Promise((resolve) => {
const param: any = {
templateId: id,
categoryId
categoryId,
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
......@@ -112,7 +120,10 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
*/
const fetchShopInfo = () => {
return new Promise((resolve) => {
PublicApi.getTemplateChannelFindChannel().then(res => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindChannel(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
......@@ -518,6 +518,7 @@ const CommodityDetail = (props) => {
shopId: storeId,
memberRoleId: commodityDetail.memberRoleId
}
PublicApi.postOrderDirectPayment(param).then(res => {
if (res.code === 1000) {
message.destroy()
......
......@@ -56,7 +56,7 @@ const SideNav: React.FC<SideNavPropsType> = (props) => {
<div className="side_nav_list_item" onClick={() => linkToPurchaseOrder()}>
<MyIcon type="icon-gouwuche" />
</div>
<div className="side_nav_list_item">
<div className="side_nav_list_item" onClick={() => history.push('/memberCenter/systemSetting/message')}>
<MyIcon type="icon-xiaoxi" />
</div>
<div className="side_nav_list_item">
......
......@@ -13,7 +13,7 @@ export function isObject(obj: any) {
return Object.prototype.toString.call(obj) === '[object Object]'
}
export function formatTimeString(date, format: string = 'YYYY-MM-DD HH:mm:ss') {
export function formatTimeString(date, format = 'YYYY-MM-DD HH:mm:ss') {
return date ? moment(date).format(format) : ''
}
......@@ -115,7 +115,7 @@ export function timeRange(val: number) {
export const arrayGroupsByCount = (array, count) => {
let index = 0;
let newArray = [];
const newArray = [];
while (index < array.length) {
newArray.push(array.slice(index, index += count));
}
......@@ -139,7 +139,7 @@ export function isPrimeNum(num) {
if (!isThree(num)) {
return false;
}
for (var i = 2; i < num / 5 + 1; i++) {
for (let i = 2; i < num / 5 + 1; i++) {
if (num % i == 0) {
return false;
}
......@@ -154,13 +154,13 @@ function isNum(num) {
}
function isDual(num) {
var num = num.toString();
var lastNum = num.substring(num.length - 1, num.length);
const lastNum = num.substring(num.length - 1, num.length);
return lastNum % 2 == 0 || lastNum % 5 == 0 ? false : true;
}
function isThree(num) {
var str = num.toString();
var sum = 0;
for (var i = 0; i < str.length; i++) {
const str = num.toString();
let sum = 0;
for (let i = 0; i < str.length; i++) {
sum += +str.substring(i, i + 1);
};
return sum % 3 == 0 ? false : true;
......@@ -528,7 +528,7 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
}
// 循环数据,找到状态值,一直覆盖
for (let i = 0; i < data.length; i++) {
if (!Boolean(data[i][customKey])) {
if (!data[i][customKey]) {
index = i - 1;
}
// 循环到最后如果 index 还是为 0 的话,说明工作流全部跑完了,此时 index 为 data.length - 1
......
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