Commit 4e8c822d authored by GuanHua's avatar GuanHua

fix:1.跳转到接单页面链接错误;2.跳转到找现货筛选错误3.询价商品未选择属性时提示

parent a5fc35ff
......@@ -126,7 +126,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
*/
const fetchShopInfo = () => {
return new Promise((resolve) => {
PublicApi.getTemplateShopFindShop().then(res => {
const param: any = {
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateShopFindShop(param).then(res => {
if (res.code === 1000) {
if (res.code === 1000) {
resolve(res.data)
......
......@@ -78,7 +78,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
}
if (priceType) {
onFilter({
key: priceType,
key: Number(priceType),
title: Number(priceType) === 1 ? '只看现价商品' : '只看询价商品',
type: FILTER_TYPE.commodityType,
})
......
......@@ -21,9 +21,6 @@ const Introduction: React.FC<IntroductionPropsType> = (props) => {
}
}, [])
useEffect(() => {
}, [commodityTemplateInfo])
const renderIntroduction = () => {
const templateName = commodityTemplateInfo ? commodityTemplateInfo.fileName || 'science' : 'science'
switch (templateName) {
......
......@@ -542,6 +542,12 @@ const CommodityDetail = (props) => {
return
}
if (!selectCommodityId) {
message.destroy()
message.info("请选择商品属性")
return
}
const values: Array<any>[] = [];
attrAndValList.attributeAndValueList.forEach((item:any, i:number) => {
values.push(item.customerAttributeValue.value);
......
......@@ -41,7 +41,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
icon: require('@/assets/mallHomeIcon/offer_icon.png')
},
{
path: '/memberCenter/tranactionAbility/saleOrder',
path: '/memberCenter/tranactionAbility/saleOrder/orderList',
title: '接单',
icon: require('@/assets/mallHomeIcon/order_icon.png')
},
......@@ -103,7 +103,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
const getRoleName = () => {
let result = ""
if (userInfo && userInfo.roles) {
for (let item of userInfo.roles) {
for (const item of userInfo.roles) {
if (item.memberRoleId === userInfo.memberRoleId) {
result = item.memberRoleName
}
......
......@@ -129,7 +129,11 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
*/
const fetchShopInfo = () => {
return new Promise((resolve) => {
PublicApi.getTemplateShopFindShop().then(res => {
const param: any = {
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateShopFindShop(param).then(res => {
if (res.code === 1000) {
if (res.code === 1000) {
resolve(res.data)
......
......@@ -2,13 +2,13 @@ import { action, observable, runInAction } from 'mobx'
import { PublicApi } from '@/services/api'
import { FILTER_TYPE } from '@/constants'
interface filterValueType {
key: string | string[];
interface FilterValueType {
key: string | string[] | number;
title: string;
type: FILTER_TYPE;
}
interface filterQuery {
interface FilterQuery {
current: number;
pageSize: number;
name?: string;
......@@ -31,7 +31,7 @@ const styleOptions = [
const getItemText = (key: number) => {
let result = ""
for (let item of styleOptions) {
for (const item of styleOptions) {
if (item.value === key) {
result = item.label
}
......@@ -61,8 +61,8 @@ class FilterStore {
* 筛选条件列表
*/
@observable filterList = []
@observable filterUpdate: boolean = false
@observable filterParam: filterQuery | {} = {}
@observable filterUpdate = false
@observable filterParam: FilterQuery | {} = {}
@observable commonlyUseFilter: any = [] // 常用筛选项
@observable commonlyUseFilterId = null
/**
......@@ -70,11 +70,11 @@ class FilterStore {
* @param filterValue
*/
@action.bound
public onFilter = (filterValue: filterValueType) => {
let filteState = this.filterList.some(item => item.type === filterValue.type)
public onFilter = (filterValue: FilterValueType) => {
const filteState = this.filterList.some(item => item.type === filterValue.type)
let tempFilterList = [...this.filterList]
if (filteState) {
if (!filterValue.key || filterValue.key.length === 0) {
if (!filterValue.key) {
tempFilterList = tempFilterList.filter(item => {
if (item.type === filterValue.type) {
return item.key === filterValue.key
......@@ -132,15 +132,12 @@ class FilterStore {
*/
@action.bound
public onFilterParamChange = (newFilterList: any) => {
let tempFilterParam: any = {}
for (let filterItem of newFilterList) {
const tempFilterParam: any = {}
for (const filterItem of newFilterList) {
switch (filterItem.type) {
case FILTER_TYPE.category:
tempFilterParam.categoryId = Number(filterItem.key[0])
break
case FILTER_TYPE.brand:
tempFilterParam.brandId = filterItem.key
break
case FILTER_TYPE.commodityType:
tempFilterParam.priceTypeList = [filterItem.key]
break
......@@ -197,9 +194,9 @@ class FilterStore {
@action.bound
public async saveCommonlyUsedFilter(name: string) {
return new Promise((resolve, reject) => {
let tempFilterParam: any = {}
const tempFilterParam: any = {}
tempFilterParam.name = name
for (let filterItem of this.filterList) {
for (const filterItem of this.filterList) {
switch (filterItem.type) {
case FILTER_TYPE.category:
tempFilterParam.customerCategoryId = filterItem.key[0]
......@@ -218,9 +215,6 @@ class FilterStore {
case FILTER_TYPE.maxPrice:
tempFilterParam.max = filterItem.key
break
case FILTER_TYPE.brand:
tempFilterParam.brandId = filterItem.key
break
case FILTER_TYPE.province:
tempFilterParam.provinceCode = filterItem.key
tempFilterParam.provinceName = filterItem.title
......@@ -254,7 +248,7 @@ class FilterStore {
*/
@action.bound
public async getCommonlyUsedFilterList() {
let param: any = {
const param: any = {
current: 1,
pageSize: 50,
}
......@@ -272,7 +266,6 @@ class FilterStore {
@action.bound
public async deleteCommonlyUsedFilterItem(id: number) {
return new Promise((resolve, reject) => {
//@ts-ignore
PublicApi.postSearchShopOftenSelectDeleteOftenSelect({ id }).then(res => {
if (res.code === 1000) {
this.getCommonlyUsedFilterList()
......@@ -294,12 +287,14 @@ class FilterStore {
} else {
this.commonlyUseFilterId = id
}
//@ts-ignore
const res = await PublicApi.getSearchShopOftenSelectGetOftenSelect({ id })
const param: any = {
id
}
const res = await PublicApi.getSearchShopOftenSelectGetOftenSelect(param)
runInAction(() => {
if (res.code === 1000) {
const data = res.data
let tempFilter = []
const tempFilter = []
if (data.customerCategoryId && data.customerCategoryName) {
tempFilter.push({
type: FILTER_TYPE.category,
......@@ -351,7 +346,7 @@ class FilterStore {
})
}
if (data.customerAttributeList) {
let newCustomerAttributeList = data.customerAttributeList.map(item => {
const newCustomerAttributeList = data.customerAttributeList.map(item => {
return {
customerAttributeId: item.id,
customerAttributeName: item.name,
......
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