Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
develop-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fd4eacef
authored
Nov 15, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
61fa563b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
49 deletions
src/common/constants.js
src/components/d2-form/index.vue
src/plugin/axios/index.js
src/store/modules/d2admin/modules/base.js
src/views/goods/editProduct.vue
src/views/systemConfig/personalInfo.vue
src/common/constants.js
View file @
fd4eace
...
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-1
2 19:10:1
3
* @Last Modified time: 2020-11-1
5 11:24:2
3
*/
// import { LOGIN_URL, REG_URL, ROLE_LIST_URL } from '@/api/sys.account'
...
...
@@ -76,33 +76,33 @@ export const ghUserType = {
// 品牌商
export
const
brandMerchantList
=
[{
confId
:
1
,
confId
:
'1'
,
confValue
:
'3M/福膜'
},
{
confId
:
2
,
confId
:
'2'
,
confValue
:
'强生/福膜'
},
{
confId
:
3
,
confId
:
'3'
,
confValue
:
'强生/斯帝飞'
},
{
confId
:
4
,
confId
:
'4'
,
confValue
:
'3M/斯帝飞'
},
{
confId
:
5
,
confId
:
'5'
,
confValue
:
'3M/今蓝'
},
{
confId
:
6
,
confId
:
'6'
,
confValue
:
'量子/今蓝'
},
{
confId
:
7
,
confId
:
'7'
,
confValue
:
'强生'
},
{
confId
:
8
,
confId
:
'8'
,
confValue
:
'今蓝'
},
{
confId
:
9
,
confId
:
'9'
,
confValue
:
'琥珀'
},
{
confId
:
10
,
confId
:
'10'
,
confValue
:
'嘀嘀虎'
}]
src/components/d2-form/index.vue
View file @
fd4eace
...
...
@@ -156,21 +156,18 @@
<
template
v-else-if=
"item.type === 'photo'"
>
<p
class=
"photo-top-tips"
>
{{
item
.
topTips
}}
</p>
<div
class=
"activity-img"
class=
"activity-img
img-w-h
"
:class=
"[disabled ? 'input-bg':'']"
>
<div
class=
"add"
v-show=
"
!formData[item.name] || (item.maxPhotoNum > 1 && (formData[item.name].length
< item
.
maxPhotoNum
))
"
v-show=
"
formData[item.name].length
< item
.
maxPhotoNum
"
>
+
</div>
<span
<
!--
<
span
class=
"number"
v-if=
"!formData[item.name] && item.maxPhotoNum === 1"
>
0/
{{
item
.
maxPhotoNum
}}
</span>
<span
class=
"number"
v-else-if=
"item.maxPhotoNum > 1 && (formData[item.name].length
< item
.
maxPhotoNum
)"
>
{{
formData
[
item
.
name
].
length
}}
/
{{
item
.
maxPhotoNum
}}
</span>
>
0/
{{
item
.
maxPhotoNum
}}
</span>
-->
<span
class=
"number"
>
{{
formData
[
item
.
name
].
length
}}
/
{{
item
.
maxPhotoNum
}}
</span>
<!--
<span
v-show=
"!formData[item.name]"
class=
"close"
...
...
@@ -178,19 +175,19 @@
>
<i
class=
"el-icon-delete"
></i>
</span>
-->
<template>
<
!--
<
template>
<img
v-if=
"
formData[item.name]
&& item.maxPhotoNum === 1"
:src=
"formData[item.name]"
v-if=
"
!formData[item.name].content
&& item.maxPhotoNum === 1"
:src=
"formData[item.name]
.content
"
alt=
""
>
</
template
>
</
template
>
-->
<input
type=
"file"
name=
'thumbUrl'
:id=
"item.name + 'file'"
ref=
"file"
class=
"activity-img"
class=
"activity-img
img-w-h
"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
click=
"handleAddClick(item)"
@
change=
"e => handleImgChange(e, item)"
...
...
@@ -198,13 +195,16 @@
>
</div>
<
template
>
<div
v-if=
"
item.maxPhotoNum > 1 && formData[item.name].length
"
>
<div
v-if=
"
formData[item.name].length && ((item.maxPhotoNum === 1 && formData[item.name].content) || (item.maxPhotoNum > 1))
"
>
<span
class=
"muti-imgs"
v-for=
"(subItem, subIndex) in formData[item.name]"
:key=
"subIndex"
>
<img
:src=
"subItem.content"
/>
<img
class=
"img-w-h"
:src=
"subItem.content"
/>
<span
class=
"close"
@
click=
'handleImgDelete(item, subIndex)'
...
...
@@ -232,20 +232,23 @@
placeholder=
"请输入详情内容"
></el-input>
<div
class=
"descList-img"
class=
"descList-img
img-w-h
"
v-else-if=
"subItem.resType === 1"
>
<img
:src=
"subItem.content"
/>
<input
type=
"file"
class=
"activity-
img
"
class=
"activity-
Input img-w-h
"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
click=
"handleAddClick(item)"
@
change=
"e => handleImgChange(e, item, subIndex)"
style=
"opacity: 0;"
>
</div>
<i
class=
"el-icon-delete"
></i>
<i
class=
"el-icon-delete"
@
click=
'handleImgDelete(item, subIndex)'
></i>
</el-row>
</
template
>
<span
v-else
>
{{item.name ? formData[item.name] : item.value}}
</span>
...
...
@@ -425,16 +428,23 @@ export default {
uploadImg
({
file
:
base64
}).
then
(
res
=>
{
console
.
log
(
res
)
// this.formData[targetItem.name].push()
if
(
!
Array
.
isArray
(
this
.
formData
[
targetItem
.
name
]))
{
console
.
log
(
targetItem
)
this
.
formData
[
targetItem
.
name
]
=
res
// if (!Array.isArray(this.formData[targetItem.name])) {
// console.log(targetItem)
// this.formData[targetItem.name] = res
// } else {
if
(
targetItem
.
maxPhotoNum
===
1
)
{
this
.
formData
[
targetItem
.
name
]
=
[{
content
:
res
}]
// this.$nextTick(() => { })
return
true
}
if
(
targetItem
.
name
===
'goodsImgList'
)
{
this
.
formData
[
targetItem
.
name
].
push
({
content
:
res
})
}
else
{
if
(
targetItem
.
name
===
'goodsImgList'
)
{
this
.
formData
[
targetItem
.
name
].
push
({
content
:
res
})
}
else
{
this
.
formData
[
targetItem
.
name
][
subIndex
].
content
=
res
}
this
.
formData
[
targetItem
.
name
][
subIndex
].
content
=
res
}
// }
console
.
log
(
this
.
formData
[
targetItem
.
name
])
})
}
...
...
@@ -512,25 +522,35 @@ export default {
margin
:
0
0
;
color
:
#999999
;
}
.d2-form
.img-w-h
{
width
:
88px
;
height
:
74px
;
}
.d2-form
.activity-img
,
.d2-form
.descList-img
{
position
:
relative
;
width
:
88px
;
height
:
74px
;
/*
width: 88px;
height: 74px;
*/
color
:
#999999
;
border
:
1px
dashed
#d9d9d9
;
cursor
:
pointer
;
margin-right
:
10px
;
}
.d2-form
.activity-Input
{
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.d2-form
.muti-imgs
{
position
:
relative
;
}
.d2-form
.muti-imgs
img
{
/*
.d2-form .muti-imgs img {
width: 88px;
height: 74px;
}
}
*/
.activity-img
img
{
width
:
100%
;
...
...
@@ -563,7 +583,9 @@ export default {
background
:
rgba
(
0
,
0
,
0
,
0.5
);
opacity
:
1
;
}
.d2-form
.el-icon-delete
{
cursor
:
pointer
;
}
.activity-img
.close
i
{
width
:
18px
;
height
:
18px
;
...
...
src/plugin/axios/index.js
View file @
fd4eace
...
...
@@ -92,7 +92,8 @@ service.interceptors.response.use(
const
ruleResult
=
baseConfig
.
axios
.
result
// 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断
if
(
dataAxios
[
ruleResult
.
code_key
]
===
'21'
)
{
var
goBackArr
=
[
'20'
,
'21'
]
if
(
goBackArr
.
includes
(
dataAxios
[
ruleResult
.
code_key
]))
{
// await store.dispatch('d2admin/account/logout')
util
.
cookies
.
remove
(
'token'
)
router
.
replace
(
'/login'
)
...
...
src/store/modules/d2admin/modules/base.js
View file @
fd4eace
...
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-1
1 17:42:11
* @Last Modified time: 2020-11-1
5 10:22:06
*/
import
{
...
...
@@ -40,7 +40,7 @@ export default {
getChannelType
({}),
getProductType
({})
]).
then
(
async
([
channelType
,
productType
])
=>
{
state
.
channelType
=
channelType
state
.
channelType
=
channelType
.
slice
(
0
,
2
)
state
.
productType
=
productType
await
dispatch
(
'save2db'
,
{
name
:
''
,
...
...
src/views/goods/editProduct.vue
View file @
fd4eace
...
...
@@ -29,8 +29,9 @@ export default {
rules
:
{
goodsName
:
[{
required
:
true
,
message
:
'请输入产品名称'
,
trigger
:
'blur'
}],
goodsType
:
[{
required
:
true
,
message
:
'请选择分类'
,
trigger
:
'blur'
}],
thumbUrl
:
[{
required
:
true
,
message
:
'请选择缩略图'
,
trigger
:
'change'
}],
goodsImgList
:
[{
required
:
true
,
message
:
'请选择产品主图'
,
trigger
:
'change'
}]
// thumbUrl: [{ required: true, message: '请选择缩略图', trigger: 'change' }],
thumbUrlList
:
[{
required
:
true
,
message
:
'请选择缩略图'
,
trigger
:
'blur'
}],
goodsImgList
:
[{
required
:
true
,
message
:
'请选择产品主图'
,
trigger
:
'blur'
}]
},
editData
:
{
goodsName
:
''
,
...
...
@@ -40,6 +41,7 @@ export default {
brandMerchantCode
:
''
,
brandMerchantName
:
''
,
thumbUrl
:
''
,
thumbUrlList
:
[],
goodsImgList
:
[],
goodsDescList
:
[{
resType
:
2
,
...
...
@@ -78,7 +80,7 @@ export default {
optionId
:
'confId'
,
optionLabel
:
'confValue'
},
{
name
:
'thumbUrl'
,
name
:
'thumbUrl
List
'
,
label
:
'缩略图'
,
type
:
'photo'
,
topTips
:
'用于在小程序主页的商品列表展示'
,
...
...
@@ -106,6 +108,8 @@ export default {
if
(
this
.
addOrEdit
===
'edit'
)
{
this
.
show
=
false
this
.
editData
=
_
.
cloneDeep
(
this
.
$route
.
params
.
form
)
this
.
editData
.
thumbUrlList
=
[]
this
.
editData
.
thumbUrlList
[
0
]
=
{
content
:
this
.
editData
.
thumbUrl
}
console
.
log
(
this
.
editData
)
this
.
$nextTick
(()
=>
{
this
.
show
=
true
...
...
@@ -136,6 +140,7 @@ export default {
handleAddConfirm
(
data
)
{
data
.
goodsDescList
=
data
.
goodsDescList
.
filter
(
item
=>
item
.
content
)
data
.
goodsTypeName
=
this
.
baseData
.
productType
.
find
(
item
=>
item
.
goodsType
===
data
.
goodsType
).
goodsTypeName
data
.
thumbUrl
=
data
.
thumbUrlList
[
0
].
content
console
.
log
(
data
)
data
.
brandMerchantCode
&&
(
data
.
brandMerchantName
=
brandMerchantList
.
find
(
item
=>
item
.
confId
===
data
.
brandMerchantCode
).
confValue
)
if
(
this
.
addOrEdit
===
'edit'
)
{
...
...
src/views/systemConfig/personalInfo.vue
View file @
fd4eace
...
...
@@ -41,6 +41,7 @@
<
script
>
import
{
getUserInfo
}
from
'@api/personalInfo'
import
{
userType
,
ghUserType
}
from
'@/common/constants'
export
default
{
name
:
'personalInfo'
,
data
()
{
...
...
@@ -62,7 +63,7 @@ export default {
name
:
'shortName'
,
label
:
'商户简称'
},
{
name
:
'userType'
,
name
:
'userType
Name
'
,
label
:
'商户分类'
},
{
name
:
'addr'
,
...
...
@@ -97,6 +98,8 @@ export default {
this
.
formData
=
res
.
detail
this
.
formData
.
addr
=
(
this
.
formData
.
provinceName
||
''
)
+
(
this
.
formData
.
cityName
||
''
)
+
(
this
.
formData
.
areaName
||
''
)
+
(
this
.
formData
.
address
||
''
)
this
.
formData
.
carBrandListNoRepeat
=
[...
new
Set
(
this
.
formData
.
carBrandList
.
map
(
item
=>
item
.
brandName
))]
var
typeList
=
this
.
formData
.
channelId
===
2
?
ghUserType
:
userType
this
.
formData
.
userTypeName
=
typeList
[
this
.
formData
.
userType
]
})
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment