Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
1a2c0276
Commit
1a2c0276
authored
Apr 11, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20230327_public_takeaway' into feature/20230315_take_out_goods
parents
b4396b47
73fe2222
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
60 additions
and
346 deletions
+60
-346
config.js
config/config.js
+2
-1
package-lock.json
package-lock.json
+1
-1
package.json
package.json
+1
-0
GoodsGroup.jsx
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
+4
-3
service.js
src/pages/GoodsManage/service.js
+2
-2
common.less
src/pages/ServiceGoods/common.less
+8
-8
AddMultiSpecModal.jsx
src/pages/ServiceGoods/components/AddMultiSpecModal.jsx
+0
-269
AddRepertoryModal.jsx
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
+2
-15
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+36
-43
UploadCropImage.jsx
src/pages/ServiceGoods/components/UploadCropImage.jsx
+2
-2
index.jsx
src/pages/ServiceGoods/index.jsx
+1
-1
service.js
src/pages/ServiceGoods/service.js
+1
-1
No files found.
config/config.js
View file @
1a2c0276
...
...
@@ -62,7 +62,7 @@ export default {
targets
:
{
ie
:
11
,
},
devtool
:
isAntDesignProPreview
?
'
source-map
'
:
false
,
devtool
:
process
.
env
.
SENTRY_ENV
===
'
test
'
?
false
:
'
hidden-source-map
'
,
// umi routes: https://umijs.org/zh/guide/router.html
routes
:
[
{
...
...
@@ -305,6 +305,7 @@ export default {
},
define
:
{
'
process.env.PRE_ENV
'
:
process
.
env
.
PRE_ENV
,
'
process.env.SENTRY_ENV
'
:
process
.
env
.
SENTRY_ENV
,
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION
:
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION
||
''
,
// preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
},
...
...
package-lock.json
View file @
1a2c0276
...
...
@@ -22487,7 +22487,7 @@
},
"react-router-dom": {
"version": "5.1.2",
"resolved": "http
s://registry.npmjs.org
/react-router-dom/-/react-router-dom-5.1.2.tgz",
"resolved": "http
://npmprivate.quantgroups.com
/react-router-dom/-/react-router-dom-5.1.2.tgz",
"integrity": "sha512-7BPHAaIwWpZS074UKaw1FjVdZBSVWEk8IuDXdB+OkLb8vd/WRQIpA4ag9WQk61aEfQs47wHyjWUoUGGZxpQXew==",
"requires": {
"@babel/runtime": "^7.1.2",
package.json
View file @
1a2c0276
...
...
@@ -7,6 +7,7 @@
"analyze"
:
"cross-env ANALYZE=1 umi build"
,
"build"
:
"umi build"
,
"build:pre"
:
"cross-env PRE_ENV=pre umi build"
,
"build:test"
:
"cross-env SENTRY_ENV=test umi build"
,
"deploy"
:
"npm run site && npm run gh-pages"
,
"fetch:blocks"
:
"pro fetch-blocks && npm run prettier"
,
"format-imports"
:
"cross-env import-sort --write '**/*.{js,jsx,ts,tsx}'"
,
...
...
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
View file @
1a2c0276
...
...
@@ -17,9 +17,10 @@ const GoodsGroup = forwardRef((options, ref) => {
const
[
tags
,
setTags
]
=
useState
([]);
const
getShopList
=
async
()
=>
{
const
user
=
localStorage
.
getItem
(
'
user
'
);
const
json
=
JSON
.
parse
(
user
);
const
res
=
await
apiSupplierShopList
(
json
.
id
);
const
res
=
await
apiSupplierShopList
({
state
:
1
,
productBusiness
:
1
,
});
if
(
res
&&
res
.
data
&&
res
.
data
.
length
>
0
)
{
setShops
(
res
.
data
.
map
(
item
=>
({
...
...
src/pages/GoodsManage/service.js
View file @
1a2c0276
...
...
@@ -320,8 +320,8 @@ export async function apiTopTakeawayGoods(data) {
});
}
// 获取供应商门店列表
export
async
function
apiSupplierShopList
()
{
return
request
.
get
(
'
/api/merchants/shops/getBySupplierId?state=1
'
,
{
export
async
function
apiSupplierShopList
(
params
)
{
return
request
.
get
(
`/api/merchants/shops/getBySupplierId?
${
stringify
(
params
)}
`
,
{
prefix
:
goodsApi
,
});
}
...
...
src/pages/ServiceGoods/common.less
View file @
1a2c0276
...
...
@@ -217,8 +217,8 @@
}
.ant-form-text {
display: flex;
justify-content: center;
align-items: center;
justify-content: center;
}
}
}
...
...
@@ -249,20 +249,20 @@
.multiSpecification {
display: flex;
flex-flow: row wrap;
:global{
:global
{
.ant-form-item-control {
flex-direction:none;
flex-direction:
none;
}
.ant-form-item-control-input-content{
flex:
none
.ant-form-item-control-input-content
{
flex:
none;
}
}
}
.specsSingularBetween {
display: flex;
align-items: center;
justify-content: flex-start;
width: max-content;
align-items:center;
:global {
.ant-form-item-label {
overflow: inherit;
...
...
@@ -336,12 +336,12 @@
}
.rowWarp {
display: flex;
background: #f8f8f8;
flex-direction: column;
background: #f8f8f8;
}
:global {
.reactEasyCrop_Container {
height:
7
50px !important;
height:
5
50px !important;
}
}
src/pages/ServiceGoods/components/AddMultiSpecModal.jsx
deleted
100644 → 0
View file @
b4396b47
This diff is collapsed.
Click to expand it.
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
View file @
1a2c0276
...
...
@@ -78,26 +78,13 @@ const AddRepertoryModal = (props, ref) => {
};
useEffect
(()
=>
{
if
(
item
?.
serviceItem
)
{
const
{
productStock
=
1
,
autoStock
=
0
,
maxStock
=
2
}
=
item
?.
serviceItem
;
const
{
productStock
=
0
,
autoStock
=
0
,
maxStock
=
0
}
=
item
?.
serviceItem
;
const
params
=
{
productStock
,
autoStock
:
+
autoStock
===
1
,
maxStock
,
};
switch
(
type
)
{
case
'
all
'
:
// 统一设置
form
.
setFieldsValue
(
params
);
break
;
case
'
multi
'
:
// 多规格设置
form
.
setFieldsValue
(
params
);
break
;
case
'
singular
'
:
// 单规格设置
// setInitialValues(params);
form
.
setFieldsValue
(
params
);
break
;
default
:
break
;
}
}
},
[
openRepertory
,
item
]);
return
(
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
1a2c0276
...
...
@@ -38,7 +38,7 @@ import UploadCropImage from './UploadCropImage';
// import AddSellTimeModal from './AddSellTimeModal';
import
styles
from
'
../common.less
'
;
import
AddRepertoryModal
from
'
./AddRepertoryModal
'
;
import
AddMultiSpecModal
from
'
./AddMultiSpecModal
'
;
//
import AddMultiSpecModal from './AddMultiSpecModal';
import
{
apiTagList
,
apiUnits
}
from
'
../service
'
;
import
{
localAutoSaveKey
,
calcDescartes
}
from
'
../utils
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
...
...
@@ -103,16 +103,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
return
null
;
}
};
// // 过滤存在的sku对象
// const objectComparison = (item, itm) => {
// console.log(item, itm, '==========');
// const {
// serviceItem: { maxStock, autoStock, productStock },
// } = itm;
// const params = { maxStock, autoStock, productStock: productStock || itm.productStock };
// const temp = { ...item, ...params };
// return temp;
// };
const
takeawayCalc
=
takeawayData
=>
{
// 商品基本信息编辑商品名称
...
...
@@ -267,7 +257,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if
(
itm
?.
specName
)
{
return
itm
.
specName
;
}
return
itm
return
itm
;
})
.
toString
();
});
...
...
@@ -303,7 +293,14 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
multiSpu
.
map
(
item
=>
{
tempMultiSpu
.
forEach
(
itm
=>
{
if
(
item
.
unique
===
itm
.
unique
)
{
item
.
serviceItem
=
{
...
item
.
serviceItem
,
...
itm
.
serviceItem
};
// 修改商品售卖信息参数
const
params
=
{
saleDates
:
temp
.
serviceItem
.
saleDates
,
saleTimes
:
temp
.
serviceItem
.
saleTimes
,
saleTimeType
:
temp
.
serviceItem
.
saleTimeType
,
minPurchaseNum
:
temp
.
serviceItem
.
minPurchaseNum
,
};
item
.
serviceItem
=
{
...
item
.
serviceItem
,
...
itm
.
serviceItem
,
...
params
};
itm
.
specs
=
[...
item
.
specs
];
}
});
...
...
@@ -349,7 +346,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const
getFormValues
=
debounce
(()
=>
{
const
values
=
form
.
getFieldsValue
();
console
.
log
(
values
,
'
values===
'
);
// debugger
props
.
onValuesChange
({
takeawayItem
:
JSON
.
parse
(
JSON
.
stringify
(
values
))
});
const
takeawayData
=
customer
.
isEdit
?
{
takeawayItem
:
Object
.
assign
({},
editData
,
values
)
}
...
...
@@ -545,10 +541,10 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const weight = specList?.filter(item => item.specGroupName === '份量');
const specs = specList?.filter(item => item.specGroupName !== '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
if (weight?.length) {
weight.forEach(item => {
if (item?.specs?.length) {
item.specs.forEach(itm => {
console.log('itm?.unit11111', itm?.unit);
if (itm?.unit && tempWeightName.includes(itm?.unit)) {
itm.quantity =
itm?.quantity.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || '';
...
...
@@ -556,6 +552,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
});
}
});
}
editData.saleTimes = saleTimes?.length
? saleTimes.map(item => [moment(item?.startTime, format), moment(item?.endTime, format)])
: [];
...
...
@@ -587,11 +584,10 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const specList = editData?.specList;
const weight = specList.filter(item => item.specGroupName === '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
if (weight?.length) {
weight.forEach(item => {
if (item?.specs?.length) {
item.specs.forEach(itm => {
console.log('itm?.unit112222', itm?.unit);
if (itm?.unit && tempWeightName.includes(itm?.unit)) {
itm.quantity =
itm?.quantity?.indexOf('约') > -1
...
...
@@ -601,6 +597,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
});
}
});
}
editData.categoryId = [firstCategoryId, secondCategoryId, thirdCategoryId];
editData.productRefShopId = editData.shopId;
// setTempWeight(weight)
...
...
@@ -611,7 +608,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
form.setFieldsValue({ specs });
const tempMultiSpu = editData?.skuList.map(item => {
if (item) {
console.log('item===', item);
item.serviceItem.productStock = item.productStock;
const weightIndex = item.specs.findIndex(itm => itm.specGroupName === '份量');
const tempQuantity = item.specs[weightIndex].quantity;
...
...
@@ -860,7 +856,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
>
{form => {
let unit = form.getFieldValue('unit') || '';
console.log('unit', unit);
unit =
(unit && (Array.isArray(unit) && unit?.length && unit?.slice(1).toString())) ||
unit;
...
...
@@ -1335,8 +1330,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
intactData={intactData}
repertoryModel={repertoryModel}
/>
{/* 加入多规格 */}
<AddMultiSpecModal ref={AddMultiSpecRef} />
</>
);
});
...
...
src/pages/ServiceGoods/components/UploadCropImage.jsx
View file @
1a2c0276
...
...
@@ -216,7 +216,7 @@ const UploadCropImage = forwardRef((props, ref) => {
onMouseEnter=
{
()
=>
setActiveImgIndex
(
index
)
}
onMouseLeave=
{
()
=>
setActiveImgIndex
(
null
)
}
>
<
div
style=
{
{
width
:
'
100%
'
,
height
:
'
10
0%
'
,
overflow
:
'
hidden
'
}
}
>
<
div
style=
{
{
width
:
'
90%
'
,
height
:
'
9
0%
'
,
overflow
:
'
hidden
'
}
}
>
<
img
width=
"100%"
key=
{
item
.
uid
}
src=
{
item
.
url
}
alt=
""
/>
</
div
>
{
activeImgIndex
===
index
&&
(
...
...
@@ -238,7 +238,7 @@ const UploadCropImage = forwardRef((props, ref) => {
{
limit
!==
null
&&
fileList
.
length
>=
limit
?
(
''
)
:
(
<
ImgCrop
rotationSlider
modalWidth=
{
900
}
modalHeight=
{
9
00
}
quality=
{
0.5
}
showReset
>
<
ImgCrop
rotationSlider
modalWidth=
{
500
}
modalHeight=
{
5
00
}
quality=
{
0.5
}
showReset
>
<
Upload
{
...
uploadParams
}
disabled=
{
Boolean
(
disabled
)
}
...
...
src/pages/ServiceGoods/index.jsx
View file @
1a2c0276
...
...
@@ -60,7 +60,7 @@ const ServiceGoods = options => {
const
[
categoryIds
,
setCategoryIds
]
=
useState
([]);
// 商品品类ID
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
// 是否是编辑状态
const
[
isUseCache
,
setIsUseCache
]
=
useState
(
false
);
// 是否使用缓存
let
ptype
=
can
TakeawayService
?
5
:
4
;
let
ptype
=
can
AddService
?
4
:
5
;
ptype
=
canAddNormal
?
1
:
ptype
;
const
[
productType
,
setProductType
]
=
useState
(
ptype
);
// 商品状态
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
// 页面加载状态
...
...
src/pages/ServiceGoods/service.js
View file @
1a2c0276
...
...
@@ -153,7 +153,7 @@ export const apiUnits = data =>
});
// 获取shopids http://yapi.quantgroups.com/project/389/interface/api/38056
export
const
apiShopIds
=
data
=>
request
.
get
(
'
/api/merchants/shops/getBySupplierId?state=1
'
,
{
request
.
get
(
'
/api/merchants/shops/getBySupplierId?state=1
&productBusiness=1
'
,
{
prefix
:
goodsApi
,
data
,
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment