Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
store-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
store-manage-ui
Commits
2cd0b9df
Commit
2cd0b9df
authored
Nov 10, 2021
by
王苓芝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营系统功能同步
parent
3d1d248f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
731 additions
and
124 deletions
+731
-124
index.js
src/router/index.js
+8
-6
user.service.js
src/services/apis/user.service.js
+94
-55
index.vue
src/view/activeTemplateManage/index.vue
+5
-8
cashPayList.vue
src/view/activityGoodManag/cashPayList.vue
+475
-0
data.js
src/view/activityGoodManag/data.js
+10
-0
specialList.vue
src/view/activityGoodManag/specialList.vue
+26
-37
activityTopicList.vue
src/view/activityManag/activityTopicList.vue
+18
-9
appConfig.vue
src/view/appconfig/appConfig.vue
+19
-9
landingHead.png
src/view/privateManage/landingHead.png
+0
-0
officialLanding.vue
src/view/privateManage/officialLanding.vue
+76
-0
No files found.
src/router/index.js
View file @
2cd0b9df
...
...
@@ -5,7 +5,7 @@ Vue.use(VueRouter);
const
home
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/common/Home.vue
'
)),
'
home
'
);
const
micro
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/common/Micro.vue
'
)),
'
microLayout
'
);
//
const adList = r => require.ensure([], () => r(require('../view/operation/AdList.vue')), 'adList');
const
adList
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/operation/AdList.vue
'
)),
'
adList
'
);
const
newAdList
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/operation/newAdList.vue
'
)),
'
newAdList
'
);
const
userManage
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/userManage/index.vue
'
)),
'
userManage
'
);
const
dayConsumeAnalysis
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/statementManage/dayConsumeAnalysis.vue
'
)),
'
dayConsumeAnalysis
'
);
...
...
@@ -23,9 +23,11 @@ const sendPush = r => require.ensure([], () => r(require('../view/sendManagement
const
sendMail
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/sendManagement/sendMail.vue
'
)),
'
sendMail
'
);
const
linkTransform
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/sendManagement/linkTransform.vue
'
)),
'
linkTransform
'
);
//
积分系列
//
会员中心
const
pointList
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/myPoint/pointList.vue
'
)),
'
pointList
'
);
const
pointRecord
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/myPoint/pointRecord.vue
'
)),
'
pointRecord
'
);
const
memberLevel
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/member/memberLevel.vue
'
)),
'
memberLevel
'
);
const
memberRights
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/member/memberRights.vue
'
)),
'
memberRights
'
);
// 用户管理
const
friendRecord
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/userManagement/friendRecord.vue
'
)),
'
friendRecord
'
);
// 奖券管理
...
...
@@ -54,10 +56,6 @@ const activeTemplateManage = r => require.ensure([], () => r(require('../view/ac
// 公众号通知消息模块
const
wechatMessage
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/wechatMessage/wechatMessage.vue
'
)),
'
wechatMessage
'
);
// 会员权益
const
memberLevel
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/member/memberLevel.vue
'
)),
'
memberLevel
'
);
const
memberRights
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/member/memberRights.vue
'
)),
'
memberRights
'
);
// 流量工厂模块
const
kaManage
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/trafficFactory/kaManage.vue
'
)),
'
kaManage
'
);
const
userGroup
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../view/userGroup
'
)),
'
userGroup
'
);
...
...
@@ -98,6 +96,10 @@ const routes = [
path
:
'
userManage
'
,
component
:
userManage
,
},
{
path
:
'
adList
'
,
component
:
adList
,
},
{
path
:
'
specialList
'
,
component
:
specialList
,
...
...
src/services/apis/user.service.js
View file @
2cd0b9df
...
...
@@ -53,6 +53,19 @@ const menus = [
},
childNodes
:
[],
},
{
node
:
{
id
:
'
dbeaef7d-acf7-4d27-9432-9421bb5743f1
'
,
name
:
'
新广告位列表
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
newAdList
'
,
},
childNodes
:
[],
},
],
},
{
...
...
@@ -184,6 +197,19 @@ const menus = [
},
childNodes
:
[],
},
{
node
:
{
id
:
'
dde9bb49-97cb-417e-b890-5cdee4bd12e1
'
,
name
:
'
发送微信公众号通知
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
wechatMessage
'
,
},
childNodes
:
[],
},
],
},
{
...
...
@@ -211,6 +237,19 @@ const menus = [
},
childNodes
:
[],
},
{
node
:
{
id
:
'
3a1cedbf-f4d6-4fe7-bcfc-8d2f327ca6cd
'
,
// 自己设置的id
name
:
'
首页布局
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
homePageLayout
'
,
},
childNodes
:
[],
},
{
node
:
{
id
:
'
3a1cedbf-f4d6-4fe7-bcfc-8d2f327ca6cc
'
,
...
...
@@ -322,7 +361,7 @@ const menus = [
{
node
:
{
id
:
'
119d1160-c446-4370-8d50-8fd749ebb39c
'
,
name
:
'
积分
'
,
name
:
'
会员中心
'
,
picture
:
'
ios-list
'
,
type
:
{
name
:
'
资源组
'
,
...
...
@@ -334,7 +373,7 @@ const menus = [
{
node
:
{
id
:
'
43a9714d-84da-459e-9182-55e06e5e717d
'
,
name
:
'
积分列表
'
,
name
:
'
会员任务
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
...
...
@@ -347,7 +386,7 @@ const menus = [
{
node
:
{
id
:
'
c13c3287-5580-4b2e-b979-bd58e5f11554
'
,
name
:
'
积分明细记录
'
,
name
:
'
成长值明细
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
...
...
@@ -357,6 +396,32 @@ const menus = [
},
childNodes
:
[],
},
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
会员等级
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
memberLevel
'
,
},
childNodes
:
[],
},
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
会员权益
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
memberRights
'
,
},
childNodes
:
[],
},
],
},
{
...
...
@@ -371,6 +436,19 @@ const menus = [
uri
:
null
,
},
childNodes
:
[
{
node
:
{
id
:
'
7fec0d98-8693-9f90-7d8e-770f958fda4b
'
,
// 此处自己设置的
name
:
'
用户管理
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
userManage
'
,
},
childNodes
:
[],
},
{
node
:
{
id
:
'
7fec0d98-8693-9f90-7d8e-770f958fda4a
'
,
...
...
@@ -403,7 +481,7 @@ const menus = [
node
:
{
id
:
'
580b8099-2c3b-43a6-8c5d-0edfc757ee38
'
,
name
:
'
活动管理
'
,
picture
:
null
,
picture
:
'
checkmark-circled
'
,
type
:
{
name
:
'
资源组
'
,
value
:
1
,
...
...
@@ -443,7 +521,7 @@ const menus = [
node
:
{
id
:
'
89deb3bc-f794-4dfa-b63f-5d0ce49a06eb
'
,
name
:
'
活动商品管理
'
,
picture
:
null
,
picture
:
'
checkmark-circled
'
,
type
:
{
name
:
'
资源组
'
,
value
:
1
,
...
...
@@ -490,30 +568,16 @@ const menus = [
},
childNodes
:
[],
},
],
},
{
node
:
{
id
:
'
72f586b1-a65b-45fb-847a-cf11c3b56bc3
'
,
name
:
'
活动模版管理
'
,
picture
:
'
ios-settings
'
,
type
:
{
name
:
'
资源组
'
,
value
:
1
,
},
uri
:
null
,
},
childNodes
:
[
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
活动模版管理
'
,
id
:
'
e8be713e-aaf1-470a-81d3-67ad15d59c62
'
,
// 自己给的id
name
:
'
支付限额商品列表
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
activeTemplateManage
'
,
uri
:
'
cashPayList
'
,
},
childNodes
:
[],
},
...
...
@@ -522,7 +586,7 @@ const menus = [
{
node
:
{
id
:
'
72f586b1-a65b-45fb-847a-cf11c3b56bc3
'
,
name
:
'
流量工厂
'
,
name
:
'
活动模版管理
'
,
picture
:
'
ios-settings
'
,
type
:
{
name
:
'
资源组
'
,
...
...
@@ -534,26 +598,13 @@ const menus = [
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
KA管理
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
kaManage
'
,
},
childNodes
:
[],
},
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
营销配置
'
,
name
:
'
活动模版管理
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
marketingAllocation
'
,
uri
:
'
activeTemplateManage
'
,
},
childNodes
:
[],
},
...
...
@@ -562,7 +613,7 @@ const menus = [
{
node
:
{
id
:
'
72f586b1-a65b-45fb-847a-cf11c3b56bc3
'
,
name
:
'
会员权益
'
,
name
:
'
私域管理
'
,
picture
:
'
ios-settings
'
,
type
:
{
name
:
'
资源组
'
,
...
...
@@ -573,27 +624,14 @@ const menus = [
childNodes
:
[
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
会员等级
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
memberLevel
'
,
},
childNodes
:
[],
},
{
node
:
{
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc3
'
,
name
:
'
等级权益
'
,
id
:
'
f802681d-cf34-4eff-8838-1839ebe54bc4
'
,
// 自己设置的id
name
:
'
公众号登录页
'
,
picture
:
null
,
type
:
{
name
:
'
菜单
'
,
value
:
2
,
},
uri
:
'
memberRights
'
,
uri
:
'
officialLanding
'
,
},
childNodes
:
[],
},
...
...
@@ -611,6 +649,7 @@ export function getMenuData() {
export
function
normalization
(
menuData
=
menus
)
{
const
value
=
[];
const
data
=
[...
menuData
];
console
.
log
(
'
data-menu
'
,
data
);
data
.
forEach
(
item
=>
{
let
obj
=
{};
obj
=
{
...
item
.
node
};
...
...
src/view/activeTemplateManage/index.vue
View file @
2cd0b9df
...
...
@@ -282,6 +282,7 @@
v-model=
"form.kaChannelNo"
ref=
"select"
filterable
:label=
"kaLabel"
class=
"select-width-280"
transfer
:disabled=
"readOnly"
...
...
@@ -547,7 +548,6 @@ export default {
remoteMethod
(
query
)
{
if
(
query
)
{
api
.
getSimpleList
({
kaChannelNameOrNo
:
query
}).
then
(
res
=>
{
console
.
log
(
res
,
'
reskalist
'
);
res
.
records
.
forEach
(
item
=>
{
item
.
label
=
item
.
channelNo
+
'
_
'
+
item
.
channelName
;
});
...
...
@@ -588,7 +588,6 @@ export default {
}
const
listDetail
=
[];
this
.
form
.
formModule
.
forEach
(
e
=>
{
console
.
log
(
'
e
'
,
e
,
this
.
form
.
type
);
const
{
startTime
,
endTime
,
bgcolor
,
img
,
cid1
,
activityGoodsSpecialId
,
timeRange
,
limitQuantity
}
=
e
;
const
itemData
=
{
startTime
,
bgcolor
,
endTime
,
img
,
cid1
,
activityGoodsSpecialId
,
timeRange
,
limitQuantity
};
itemData
.
startTime
=
this
.
form
.
type
!==
1
?
''
:
this
.
form
.
timeSelectionFormat
===
0
?
getTime
(
itemData
.
startTime
)
:
getTime
(
timeRange
[
0
]);
...
...
@@ -601,7 +600,6 @@ export default {
itemData
.
img
=
this
.
form
.
type
===
1
?
itemData
&&
itemData
.
img
[
0
]
:
''
;
listDetail
.
push
(
itemData
);
});
console
.
log
(
listDetail
);
const
param
=
deepCopy
(
this
.
form
);
param
.
zeroBuyRule
&&
param
.
zeroBuyRule
.
forEach
(
item
=>
{
...
...
@@ -610,7 +608,6 @@ export default {
delete
item
.
specialCaseRatio
;
}
});
console
.
log
(
param
,
'
param
'
);
param
.
bannerUrl
=
param
.
bannerUrl
&&
param
.
bannerUrl
.
join
(
''
);
// param.showBanner = +this.form.showBanner;
if
(
this
.
form
.
type
===
1
)
{
...
...
@@ -684,7 +681,7 @@ export default {
this
.
title
=
'
新建
'
;
},
async
getInfo
(
params
,
type
)
{
this
.
f
irstEdit
=
true
;
this
.
f
orm
=
{}
;
this
.
kaChannelList
=
[];
this
.
readOnly
=
type
;
this
.
title
=
type
?
'
查看
'
:
'
修改
'
;
...
...
@@ -695,10 +692,11 @@ export default {
if
(
item
.
channelNo
===
res
.
kaChannelNo
)
{
this
.
kaLabel
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
}
item
.
label
=
item
.
channelNo
+
'
_
'
+
item
.
channelName
;
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
Object
.
assign
([],
...
result
.
records
)
;
this
.
kaChannelList
=
result
.
records
;
}
this
.
changeChannel
(
res
.
kaChannelNo
);
this
.
editContent
=
res
;
// delete res.kaChannelNo;
const
listDetail
=
[];
...
...
@@ -714,7 +712,6 @@ export default {
this
.
form
.
img
=
(
this
.
form
.
img
&&
this
.
form
.
img
.
split
(
'
,
'
))
||
[];
this
.
form
.
bannerUrl
=
this
.
form
.
bannerUrl
&&
this
.
form
.
bannerUrl
.
split
(
'
,
'
);
this
.
form
.
couponMutex
=
res
.
couponMutex
&&
res
.
couponMutex
?
1
:
0
;
this
.
firstEdit
=
false
;
this
.
modal
=
true
;
},
newDel
(
index
,
isFormModule
,
crowd
)
{
...
...
src/view/activityGoodManag/cashPayList.vue
0 → 100644
View file @
2cd0b9df
<
template
>
<div
class=
"about"
>
<Form
inline
:label-width=
"88"
>
<Table
border
:columns=
"columns"
:data=
"cashData"
></Table>
<Modal
v-model=
"cashModal"
width=
"600"
:closable=
"false"
:mask-closable=
"false"
>
<h3>
编辑
</h3>
<Form
:model=
"form"
:rules=
"ruleValidate"
ref=
"ruleForm"
:label-width=
"120"
style=
"margin-top: 20px"
>
<FormItem
label=
"限制商品类型"
>
<Select
v-model.number=
"form.type"
style=
"width: 150px"
placeholder=
"请选择"
clearable
>
<Option
v-for=
"item in limitgoodsList"
:key=
"item.id"
:value=
"item.id"
>
{{
item
.
name
}}
</Option>
</Select>
</FormItem>
<FormItem
label=
"标签ID:"
prop=
"usedLimitLabelIds"
v-if=
"form.type === 1"
>
<Select
v-model=
"form.usedLimitLabelIds"
style=
"width: 250px"
multiple
transfer
placeholder=
"请选择"
clearable
>
<Option
v-for=
"item in labelList"
:key=
"item.id"
:value=
"item.id"
:label=
"item.labelName"
>
{{
item
.
labelName
}}
</Option>
</Select>
</FormItem>
<FormItem
label=
"商品品类:"
prop=
"selectUsedCategoryIdList"
v-if=
"form.type === 2"
>
<treeselect
v-model=
"form.selectUsedCategoryIdList"
:disabled=
"showDisabled"
multiple
:options=
"productCategory"
:normalizer=
"normalizer"
placeholder=
"请选择"
style=
"width: 250px"
/>
<!--
<p
class=
"color_red"
>
#不选默认即为全选
</p>
-->
</FormItem>
<FormItem
label=
"毛利小于"
v-if=
"form.type === 2"
prop=
"preProfit"
>
<Input
v-model=
"form.preProfit"
style=
"width: 50px"
/>
%
</FormItem>
</Form>
<div
slot=
"footer"
>
<Button
type=
"primary"
@
click=
"onSave()"
>
保存
</Button>
<Button
@
click=
"onCancel"
>
取消
</Button>
</div>
</Modal>
<Modal
v-model=
"cashDetailModal"
width=
"900"
:closeable=
"false"
:mask-closable=
"true"
>
<h3>
查看详情
</h3>
<Form
ref=
"ruleDetailForm"
:model=
"detailForm"
:rules=
"rule"
:label-width=
"120"
style=
"margin-top: 20px"
>
<Table
border
:columns=
"detailColumns"
:data=
"detailData"
></Table>
</Form>
<Page
:total=
"total"
show-total
:current.sync=
"search.pageNo"
:page-size=
"search.pageSize"
show-elevator
style=
"margin-top: 20px"
@
on-change=
"changePage"
/>
<div
slot=
"footer"
>
<Button
type=
"primary"
@
click=
"onSure()"
>
确定
</Button>
</div>
</Modal>
</Form>
</div>
</
template
>
<
script
>
import
activityApi
from
'
../../services/apis/activity.service
'
;
import
couponSerivce
from
'
../../services/apis/coupon.service
'
;
import
Treeselect
from
'
@riophae/vue-treeselect
'
;
import
'
@riophae/vue-treeselect/dist/vue-treeselect.css
'
;
import
{
limitgoodsList
}
from
'
./data.js
'
;
export
default
{
components
:
{
Treeselect
,
},
data
()
{
return
{
form
:
{
type
:
''
,
id
:
''
,
selectUsedCategoryIdList
:
[],
preProfit
:
''
,
usedLimitLabelIds
:
[],
},
search
:
{
pageNo
:
1
,
pageSize
:
10
,
},
total
:
0
,
ruleValidate
:
{
usedLimitLabelIds
:
[
{
required
:
true
,
message
:
'
请选择标签
'
,
trigger
:
'
change
'
,
type
:
'
array
'
,
},
],
},
treeData
:
[],
treeNode
:
[],
oldNode
:
[],
cashData
:
[],
cashModal
:
false
,
cashDetailModal
:
false
,
limitgoodsList
,
labelList
:
[],
productCategory
:
[],
detailData
:
[],
sourceList
:
{
1
:
'
自营
'
,
2
:
'
京东开普勒
'
,
3
:
'
京东联盟
'
,
4
:
'
众联
'
,
5
:
'
企业购
'
,
6
:
'
企业购直连
'
,
},
typeList
:
{
// 0: '不限制',
1
:
'
标签
'
,
2
:
'
品类
'
,
},
detailColumns
:
[
{
key
:
'
rank
'
,
title
:
'
ID
'
,
align
:
'
center
'
,
},
{
key
:
'
skuNo
'
,
title
:
'
sku_no
'
,
align
:
'
center
'
,
width
:
'
140px
'
,
},
{
key
:
'
skuName
'
,
title
:
'
商品名称
'
,
align
:
'
center
'
,
width
:
'
150px
'
,
},
{
key
:
'
skuSource
'
,
title
:
'
商品渠道
'
,
align
:
'
center
'
,
width
:
'
100px
'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'
div
'
,
this
.
sourceList
[
params
.
row
.
skuSource
]);
},
},
{
key
:
'
salePrice
'
,
title
:
'
销售价格
'
,
align
:
'
center
'
,
width
:
'
100px
'
,
},
{
key
:
'
marketPrice
'
,
title
:
'
划线价格
'
,
align
:
'
center
'
,
width
:
'
100px
'
,
},
{
key
:
'
costPrice
'
,
title
:
'
供货价格
'
,
align
:
'
center
'
,
width
:
'
100px
'
,
},
{
key
:
'
goodsStatus
'
,
title
:
'
商品状态
'
,
align
:
'
center
'
,
width
:
'
100px
'
,
render
:
h
=>
{
return
h
(
'
div
'
,
'
上架
'
);
},
},
],
columns
:
[
{
key
:
'
id
'
,
title
:
'
ID
'
,
align
:
'
center
'
,
},
{
key
:
'
type
'
,
title
:
'
限制商品类型
'
,
align
:
'
center
'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'
div
'
,
params
.
row
.
type
?
this
.
typeList
[
params
.
row
.
type
]
:
'
不限制
'
);
},
},
{
key
:
'
skuInfoSize
'
,
title
:
'
商品数量
'
,
align
:
'
center
'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'
div
'
,
params
.
row
.
type
?
params
.
row
.
skuInfoSize
:
'
xxx
'
);
},
},
{
key
:
'
action
'
,
title
:
'
操作
'
,
align
:
'
center
'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'
div
'
,
[
h
(
'
Button
'
,
{
props
:
{
type
:
'
primary
'
,
},
style
:
{
margin
:
'
2px 5px
'
,
},
on
:
{
click
:
()
=>
{
console
.
log
(
params
.
row
,
'
paramsrow
'
);
this
.
showEdit
(
params
.
row
);
},
},
},
'
编辑
'
),
h
(
'
Button
'
,
{
props
:
{
type
:
'
primary
'
,
},
style
:
{
margin
:
'
2px 5px
'
,
},
on
:
{
click
:
()
=>
{
this
.
showDetail
(
params
.
row
);
},
},
},
'
查看详情
'
),
h
(
'
Button
'
,
{
props
:
{
type
:
'
primary
'
,
},
on
:
{
click
:
()
=>
{
this
.
useOrStop
(
params
.
row
.
enable
);
},
},
},
params
.
row
.
enable
===
'
VALID
'
?
'
停用
'
:
'
启用
'
),
h
(
'
Button
'
,
{
props
:
{
type
:
'
primary
'
,
},
style
:
{
margin
:
'
2px 5px
'
,
},
on
:
{
click
:
()
=>
{
this
.
exportProductByLabel
(
params
.
row
);
},
},
},
'
导出标签商品列表
'
),
]);
},
},
],
};
},
methods
:
{
spread
(
node
)
{
console
.
log
(
node
,
'
node
'
);
if
(
node
.
children
)
{
node
.
children
.
map
(
item
=>
{
if
(
!
item
.
children
)
{
this
.
treeData
.
push
(
item
.
id
);
}
else
{
item
.
children
.
map
(
it
=>
{
if
(
!
it
.
children
)
{
this
.
treeData
.
push
(
it
.
id
);
}
else
{
it
.
children
.
map
(
itemData
=>
{
if
(
!
itemData
.
children
)
{
this
.
treeData
.
push
(
itemData
.
id
);
}
});
}
});
}
});
}
else
{
this
.
treeData
.
push
(
node
.
id
);
}
},
delete
(
node
)
{
if
(
node
.
children
)
{
node
.
children
.
map
(
item
=>
{
if
(
!
item
.
children
)
{
this
.
form
.
selectUsedCategoryIdList
.
splice
(
this
.
form
.
selectUsedCategoryIdList
.
indexOf
(
item
.
id
),
1
);
}
else
{
item
.
children
.
map
(
it
=>
{
if
(
!
it
.
children
)
{
this
.
form
.
selectUsedCategoryIdList
.
splice
(
this
.
form
.
selectUsedCategoryIdList
.
indexOf
(
it
.
id
),
1
);
}
else
{
it
.
children
.
map
(
itemData
=>
{
if
(
!
itemData
.
children
)
{
this
.
form
.
selectUsedCategoryIdList
.
splice
(
this
.
form
.
selectUsedCategoryIdList
.
indexOf
(
itemData
.
id
),
1
);
}
});
}
});
}
});
}
else
{
return
;
}
},
showEdit
(
params
)
{
this
.
cashModal
=
true
;
this
.
treeData
=
[];
this
.
oldNode
=
[];
this
.
form
=
{
...
params
};
this
.
form
.
usedLimitLabelIds
=
params
.
type
===
1
?
params
.
limitIds
.
split
(
'
,
'
).
map
(
i
=>
(
i
=
+
i
))
:
[];
this
.
form
.
selectUsedCategoryIdList
=
params
.
type
===
2
?
params
.
limitIds
.
split
(
'
,
'
)
:
[];
console
.
log
(
this
.
productCategory
,
'
this.productCategory
'
);
this
.
form
.
selectUsedCategoryIdList
.
map
(
item
=>
{
this
.
findNode
(
this
.
productCategory
,
item
);
});
this
.
oldNode
.
map
(
item
=>
{
this
.
delete
(
item
);
});
},
findNode
(
list
,
value
)
{
list
.
map
(
item
=>
{
if
(
item
.
id
===
value
)
{
this
.
oldNode
.
push
(
item
);
this
.
treeNode
.
push
(
item
);
}
else
if
(
item
.
children
)
{
this
.
findNode
(
item
.
children
,
value
);
}
});
},
showDetail
()
{
// 查看详情
this
.
cashDetailModal
=
true
;
this
.
search
.
pageNo
=
1
;
activityApi
.
lookDetails
({
pageNo
:
this
.
search
.
pageNo
,
pageSize
:
10
}).
then
(
res
=>
{
if
(
this
.
search
.
pageNo
*
10
<
this
.
total
)
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
res
[
i
].
rank
=
(
this
.
search
.
pageNo
-
1
)
*
10
+
1
+
i
;
}
}
else
{
for
(
let
i
=
0
;
i
<
this
.
total
-
(
this
.
search
.
pageNo
-
1
)
*
10
;
i
++
)
{
res
[
i
].
rank
=
(
this
.
search
.
pageNo
-
1
)
*
10
+
1
+
i
;
}
}
this
.
detailData
=
res
;
});
},
getChooseList
()
{
couponSerivce
.
labelInfoList
().
then
(
res
=>
{
res
.
forEach
(
item
=>
{
item
.
labelName
=
`
${
item
.
id
}
--
${
item
.
labelName
}
`
;
});
this
.
labelList
=
res
;
});
couponSerivce
.
threeCategoryQuery
().
then
(
res
=>
{
this
.
productCategory
=
res
.
level1List
?
recursionData
(
res
.
level1List
)
:
[];
function
recursionData
(
data
)
{
const
list
=
[];
data
.
forEach
(
item
=>
{
const
{
categoryId
:
id
,
categoryName
:
label
,
children
}
=
item
;
const
itemData
=
{
id
:
id
+
''
,
label
};
if
(
item
.
children
&&
item
.
children
.
length
)
itemData
.
children
=
recursionData
(
children
);
list
.
push
(
itemData
);
});
return
list
;
}
});
this
.
query
();
},
normalizer
(
node
)
{
// 去掉children=[]的children属性
// 参数options的数据转换
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
delete
node
.
children
;
}
return
{
id
:
node
.
id
||
null
,
// 将name转换成必填的label键
label
:
node
.
label
,
children
:
node
.
children
,
};
},
onCancel
()
{
this
.
cashModal
=
false
;
},
onSure
()
{
this
.
cashDetailModal
=
false
;
},
onSave
()
{
this
.
treeNode
=
[];
if
(
this
.
form
.
selectUsedCategoryIdList
)
{
this
.
form
.
selectUsedCategoryIdList
.
map
(
item
=>
{
this
.
findNode
(
this
.
productCategory
,
item
);
});
}
console
.
log
(
this
.
treeNode
,
'
treeNode
'
);
if
(
this
.
form
.
type
===
2
)
{
console
.
log
(
'
123345r563456
'
);
this
.
treeNode
.
map
(
item
=>
{
this
.
spread
(
item
);
});
this
.
treeData
=
[...
this
.
treeData
,
...
this
.
form
.
selectUsedCategoryIdList
];
this
.
treeData
=
Array
.
from
(
new
Set
(
this
.
treeData
));
console
.
log
(
this
.
treeData
,
'
000000000
'
);
}
this
.
$refs
[
'
ruleForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
const
params
=
{
...
this
.
form
,
preProfit
:
this
.
form
.
preProfit
?
this
.
form
.
preProfit
:
'
100.00
'
,
limitIds
:
this
.
form
.
type
===
1
?
this
.
form
.
usedLimitLabelIds
.
join
(
'
,
'
)
:
this
.
treeData
.
join
(
'
,
'
),
};
delete
params
.
selectUsedCategoryIdList
;
delete
params
.
usedLimitLabelIds
;
delete
params
.
skuInfos
;
if
(
+
params
.
preProfit
<
0
||
+
params
.
preProfit
>
100
)
{
this
.
$Message
.
error
(
'
请输入大于等于0且小于等于100的数
'
);
return
;
}
activityApi
.
getCashLimitList
(
params
).
then
(()
=>
{
this
.
$Message
.
success
(
'
保存成功!
'
);
this
.
treeData
=
[];
this
.
cashModal
=
false
;
this
.
query
();
});
}
else
{
this
.
$Message
.
error
(
'
请检查表单是否填写完整!
'
);
}
});
},
async
exportProductByLabel
()
{
// todo 导出现金支付的商品数据列表
await
activityApi
.
exportCashList
();
},
query
()
{
activityApi
.
getCashList
().
then
(
res
=>
{
console
.
log
(
res
,
'
res
'
);
this
.
cashData
=
[
res
];
this
.
total
=
res
.
skuInfoSize
;
});
},
changePage
(
page
)
{
this
.
search
.
pageNo
=
page
;
activityApi
.
lookDetails
({
pageNo
:
this
.
search
.
pageNo
,
pageSize
:
10
}).
then
(
res
=>
{
if
(
this
.
search
.
pageNo
*
10
<
this
.
total
)
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
res
[
i
].
rank
=
(
this
.
search
.
pageNo
-
1
)
*
10
+
1
+
i
;
}
}
else
{
for
(
let
i
=
0
;
i
<
this
.
total
-
(
this
.
search
.
pageNo
-
1
)
*
10
;
i
++
)
{
res
[
i
].
rank
=
(
this
.
search
.
pageNo
-
1
)
*
10
+
1
+
i
;
}
}
this
.
detailData
=
res
;
});
},
// 0:停用、1:启用
useOrStop
(
enable
)
{
const
params
=
{
enable
:
enable
===
'
VALID
'
?
0
:
1
,
};
activityApi
.
updateStatus
(
params
).
then
(()
=>
{
this
.
$Notice
.
success
({
title
:
'
操作成功!
'
,
});
this
.
query
();
});
},
},
mounted
()
{
this
.
getChooseList
();
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.color_red {
color: red;
}
</
style
>
src/view/activityGoodManag/data.js
View file @
2cd0b9df
...
...
@@ -142,3 +142,13 @@ export const dynamicRules = {
pattern
:
/^
[
0-9
]
*
[
1-9
][
0-9
]
*$/
,
},
};
export
const
limitgoodsList
=
[
{
id
:
2
,
name
:
'
指定品类
'
,
},
{
id
:
1
,
name
:
'
指定标签
'
,
},
];
src/view/activityGoodManag/specialList.vue
View file @
2cd0b9df
...
...
@@ -65,6 +65,7 @@
class=
"select-width-280"
:disabled=
"disabled()"
transfer
:label=
"kaLabel"
clearable
filterable
remote
...
...
@@ -73,7 +74,7 @@
:not-found-text=
"kaChannelList.length !== 0 ? '' : '无匹配数据'"
placeholder=
"请输入"
>
<Option
v-for=
"item in kaChannelList"
:key=
"item.channelNo"
:value=
"item.channelNo"
>
{{
item
.
channelNo
+
'
_
'
+
item
.
channelName
}}
</Option>
<Option
v-for=
"item in kaChannelList"
:key=
"item.channelNo"
:value=
"item.channelNo"
:label=
"item.label"
>
</Option>
</Select>
<p
style=
"color: #ff6600"
>
提示:此参数配置选中后,表示以上配置内容仅在此渠道生效;
</p>
</FormItem>
...
...
@@ -117,6 +118,7 @@ export default {
},
data
()
{
return
{
kaLabel
:
''
,
kaReminderModal
:
false
,
channelTitle
:
''
,
search
:
{
...
...
@@ -133,7 +135,7 @@ export default {
activityTime
:
[],
kaChannelList
:
[],
form
:
{
kaChannelNo
:
[]
,
kaChannelNo
:
''
,
listSpecialLabel
:
[
{
labelInfoId
:
null
,
...
...
@@ -311,14 +313,15 @@ export default {
remoteMethod
(
query
)
{
if
(
query
)
{
api
.
getSimpleList
({
kaChannelNameOrNo
:
query
}).
then
(
res
=>
{
// console.log(res, 'reskalist');
res
.
records
.
forEach
(
item
=>
{
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
res
.
records
||
[];
});
}
},
changeChannel
(
item
)
{
if
(
item
)
{
console
.
log
(
this
.
form
.
kaChannelNo
,
'
0000000
'
);
this
.
channelTitle
=
this
.
kaChannelList
.
find
(
i
=>
i
.
channelNo
===
item
).
channelName
;
}
},
...
...
@@ -326,7 +329,6 @@ export default {
this
.
kaReminderModal
=
false
;
this
.
form
.
startTime
=
getTime
(
this
.
activityTime
&&
this
.
activityTime
[
0
]);
this
.
form
.
endTime
=
getTime
(
this
.
activityTime
&&
this
.
activityTime
[
1
]);
console
.
log
(
this
.
form
,
'
this.form
'
);
if
(
this
.
title
===
'
新增
'
)
{
this
.
$refs
[
'
ruleForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
...
...
@@ -403,32 +405,6 @@ export default {
onSure
()
{
this
.
kaReminderModal
=
true
;
// this.form.startTime = getTime(this.activityTime && this.activityTime[0]);
// this.form.endTime = getTime(this.activityTime && this.activityTime[1]);
// if (this.title === '新增') {
// this.$refs['ruleForm'].validate(valid => {
// if (valid) {
// if (!this.form.startTime) {
// return this.$Message.error('请检查专题有效期!');
// }
// this.$refs.nextModalRef.openNextTemplateModal(this.form, 0);
// } else {
// this.$Message.error('请检查表单是否填写完整!');
// }
// });
// }
// if (this.title === '编辑') {
// const delItem = [];
// this.delNameList.forEach(item => {
// if (!this.labelNameList.includes(item)) {
// delItem.push(item.id);
// }
// });
// if (delItem.length) {
// activityApi.specialDeleteLabel({ ids: delItem.join(',') });
// }
// this.$refs.nextModalRef.openNextTemplateModal(this.form, 1);
// }
},
disabled
()
{
if
(
this
.
title
===
'
编辑
'
)
return
true
;
...
...
@@ -439,9 +415,18 @@ export default {
return
true
;
},
showEdit
(
e
)
{
this
.
form
=
{
listSpecialLabel
:
[
{
labelInfoId
:
null
,
goodsCount
:
null
,
},
],
};
this
.
kaChannelList
=
[];
this
.
kaLabel
=
''
;
this
.
title
=
'
编辑
'
;
activityApi
.
specialGet
({
id
:
e
.
id
}).
then
(
res
=>
{
console
.
log
(
res
,
'
resres
'
);
this
.
form
.
name
=
res
.
name
;
this
.
form
.
id
=
res
.
id
;
this
.
form
.
discount
=
res
.
discount
*
10
;
...
...
@@ -449,14 +434,18 @@ export default {
this
.
activityTime
=
[
res
.
startTime
,
res
.
endTime
];
this
.
labelNameList
=
[...
res
.
listSpecialLabel
];
this
.
delNameList
=
[...
res
.
listSpecialLabel
];
console
.
log
(
this
.
form
.
kaChannelNo
);
if
(
res
.
kaChannelNo
)
{
api
.
getSimpleList
({
kaChannelNameOrNo
:
res
.
kaChannelNo
}).
then
(
result
=>
{
console
.
log
(
result
,
'
reskalist
'
);
this
.
kaChannelList
=
result
.
records
||
[];
this
.
$nextTick
(()
=>
{
this
.
form
.
kaChannelNo
=
res
.
kaChannelNo
;
result
.
records
.
forEach
(
item
=>
{
if
(
item
.
channelNo
===
res
.
kaChannelNo
)
{
this
.
kaLabel
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
}
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
result
.
records
||
[];
// this.$nextTick(() => {
this
.
form
.
kaChannelNo
=
res
.
kaChannelNo
;
// });
});
}
});
...
...
src/view/activityManag/activityTopicList.vue
View file @
2cd0b9df
...
...
@@ -47,6 +47,7 @@
v-model=
"form.kaChannelNo"
class=
"select-width-280"
:disabled=
"isEdit"
:label=
"kaLabel"
filterable
remote
:remote-method=
"remoteMethod"
...
...
@@ -56,7 +57,7 @@
:not-found-text=
"kaChannelList.length !== 0 ? '' : '无匹配数据'"
placeholder=
"请输入"
>
<Option
v-for=
"item in kaChannelList"
:key=
"item.channelNo"
:value=
"item.channelNo"
>
{{
item
.
channelNo
+
'
_
'
+
item
.
channelName
}}
</Option>
<Option
v-for=
"item in kaChannelList"
:key=
"item.channelNo"
:value=
"item.channelNo"
:label=
"item.label"
>
</Option>
</Select>
<p
style=
"color: #ff6600"
>
提示:此参数配置选中后,表示以上配置内容仅在此渠道生效;
</p>
</FormItem>
...
...
@@ -143,6 +144,7 @@ export default {
},
data
()
{
return
{
kaLabel
:
''
,
channelTitle
:
''
,
kaReminderModal
:
false
,
search
:
{
...
...
@@ -300,20 +302,17 @@ export default {
},
methods
:
{
remoteMethod
(
query
)
{
console
.
log
(
'
99999999999
'
);
if
(
query
)
{
api
.
getSimpleList
({
kaChannelNameOrNo
:
query
}).
then
(
res
=>
{
res
.
records
.
forEach
(
item
=>
{
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
res
.
records
||
[];
});
}
},
changeChannel
(
item
)
{
if
(
item
)
{
setTimeout
(()
=>
{
console
.
log
(
this
.
kaChannelList
,
'
item888
'
);
this
.
channelTitle
=
this
.
kaChannelList
.
find
(
i
=>
i
.
channelNo
===
item
).
channelName
;
},
300
);
console
.
log
(
item
,
'
item111
'
);
activityApi
.
reductionList
({
kaChannelNo
:
item
}).
then
(
res
=>
{
this
.
templateList
=
res
||
[];
});
...
...
@@ -368,9 +367,15 @@ export default {
this
.
search
=
{};
},
onSure
()
{
if
(
this
.
form
.
kaChannelNo
)
{
this
.
channelTitle
=
this
.
kaChannelList
.
find
(
i
=>
i
.
channelNo
===
this
.
form
.
kaChannelNo
).
channelName
;
}
this
.
kaReminderModal
=
true
;
},
showDetail
(
data
,
isEdit
)
{
this
.
form
=
{};
this
.
kaChannelList
=
[];
// this.kaLabel = '';
this
.
editId
=
data
.
id
;
this
.
title
=
isEdit
?
'
查看活动
'
:
'
编辑活动
'
;
this
.
isEdit
=
isEdit
;
...
...
@@ -379,7 +384,12 @@ export default {
const
{
startTime
,
endTime
,
url
,
title
,
activityTemplateId
,
forward
,
shareTitle
,
shareSubTitle
,
iconUrl
,
kaChannelNo
}
=
res
;
if
(
res
.
kaChannelNo
)
{
api
.
getSimpleList
({
kaChannelNameOrNo
:
res
.
kaChannelNo
}).
then
(
result
=>
{
// console.log(res, 'reskalist');
result
.
records
.
forEach
(
item
=>
{
if
(
item
.
channelNo
===
res
.
kaChannelNo
)
{
this
.
kaLabel
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
}
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
result
.
records
||
[];
this
.
$nextTick
(()
=>
{
this
.
form
.
kaChannelNo
=
kaChannelNo
;
...
...
@@ -390,7 +400,6 @@ export default {
this
.
templateList
=
r
||
[];
this
.
form
=
{
startTime
,
endTime
,
url
,
title
,
activityTemplateId
,
forward
,
shareTitle
,
shareSubTitle
,
iconUrl
};
this
.
form
=
res
;
console
.
log
(
this
.
form
,
'
this.form
'
);
this
.
form
.
activityPlaybillUrl
=
(
this
.
form
.
activityPlaybillUrl
&&
this
.
form
.
activityPlaybillUrl
.
split
(
'
,
'
))
||
[];
this
.
form
.
iconUrl
=
(
this
.
form
.
iconUrl
&&
this
.
form
.
iconUrl
.
split
(
'
,
'
))
||
[];
this
.
form
.
terminal
=
res
.
terminal
.
split
(
'
,
'
);
...
...
src/view/appconfig/appConfig.vue
View file @
2cd0b9df
...
...
@@ -43,6 +43,7 @@
class=
"select-width-280"
:disabled=
"!!form.id"
filterable
:label=
"kaLabel"
remote
:remote-method=
"remoteMethod"
transfer
...
...
@@ -51,7 +52,7 @@
placeholder=
"请输入"
:not-found-text=
"kaChannelList.length !== 0 ? '' : '无匹配数据'"
>
<Option
v-for=
"item in kaChannelList"
:key=
"item.channelNo"
:value=
"item.channelNo"
>
{{
item
.
channelNo
+
'
_
'
+
item
.
channelName
}}
</Option>
<Option
v-for=
"item in kaChannelList"
:key=
"item.channelNo"
:value=
"item.channelNo"
:label=
"item.label"
>
</Option>
</Select>
<p
style=
"color: #ff6600"
>
提示:此参数配置选中后,表示以上配置内容仅在此渠道生效;
</p>
</FormItem>
...
...
@@ -215,6 +216,7 @@ export default {
},
data
()
{
return
{
kaLabel
:
''
,
kaReminderModal
:
false
,
channelTitle
:
''
,
title
:
''
,
...
...
@@ -430,17 +432,24 @@ export default {
if
(
params
.
row
.
elementType
===
101
)
{
this
.
form
=
{};
}
this
.
form
=
{};
this
.
kaLabel
=
''
;
this
.
kaChannelList
=
[];
api
.
find
({
id
:
params
.
row
.
id
}).
then
(
res
=>
{
if
(
res
.
kaChannelNo
)
{
this
.
kaChannelNo
=
res
.
kaChannelNo
;
delete
res
.
kaChannelNo
;
//
delete res.kaChannelNo;
apis
.
getSimpleList
({
kaChannelNameOrNo
:
this
.
kaChannelNo
}).
then
(
result
=>
{
// console.log(res, 'reskalist');
this
.
kaChannelList
=
result
.
records
||
[];
console
.
log
(
this
.
kaChannelList
,
'
this.kaChannelList
'
)
;
this
.
$nextTick
(()
=>
{
this
.
form
.
kaChannelNo
=
this
.
kaChannelNo
;
result
.
records
.
forEach
(
item
=>
{
if
(
item
.
channelNo
===
res
.
kaChannelNo
)
{
this
.
kaLabel
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
}
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
result
.
records
||
[];
// this.$nextTick(() => {
this
.
form
.
kaChannelNo
=
this
.
kaChannelNo
;
// });
});
}
if
(
res
.
elementType
===
101
)
{
...
...
@@ -641,7 +650,9 @@ export default {
remoteMethod
(
query
)
{
if
(
query
)
{
apis
.
getSimpleList
({
kaChannelNameOrNo
:
query
}).
then
(
res
=>
{
// console.log(res, 'reskalist');
res
.
records
.
forEach
(
item
=>
{
item
.
label
=
`
${
item
.
channelNo
}
_
${
item
.
channelName
}
`
;
});
this
.
kaChannelList
=
res
.
records
||
[];
});
}
...
...
@@ -1007,7 +1018,6 @@ export default {
img
:
(
this
.
form
.
img
&&
this
.
form
.
img
.
join
(
'
,
'
))
||
''
,
badgeUrl
:
(
this
.
form
.
badgeUrl
&&
this
.
form
.
badgeUrl
.
join
(
'
,
'
))
||
''
,
};
console
.
log
(
params
,
'
888888888
'
);
if
(
this
.
form
.
id
)
{
delete
params
.
elementTypeEdit
;
delete
params
.
terminalEdit
;
...
...
src/view/privateManage/landingHead.png
0 → 100644
View file @
2cd0b9df
87.7 KB
src/view/privateManage/officialLanding.vue
0 → 100644
View file @
2cd0b9df
<
template
>
<div
style=
"margin-left: 30px;margin-top: 30px;"
>
<p>
上传介绍图一:
<upload
:uploadurl=
"upImgUri"
:max=
"1"
qiniu-host=
""
/></p>
<p
style=
"margin-top:10px"
>
上传介绍图二:
<upload
:uploadurl=
"downImgUri"
:max=
"1"
qiniu-host=
""
/></p>
<div
style=
"margin-top: 10px"
>
<Button
type=
"primary"
@
click=
"onSure"
:disabled=
"isUpload"
>
确认
</Button>
<span
v-if=
"uploadSuccess"
style=
"display: inline-block"
@
click=
"showPreview"
><Button>
点击预览
</Button></span>
</div>
<div
v-if=
"isPreview"
style=
"display:flex;flex-direction:column;margin-top:10px"
>
<h2>
预览
</h2>
<img
src=
"./landingHead.png"
alt=
""
style=
"height:auto;width:200px"
/>
<img
:src=
"preview.upimg"
style=
"height:auto;width:200px"
/>
<img
:src=
"preview.downimg"
style=
"height:auto;width:200px"
/>
</div>
</div>
</
template
>
<
script
>
import
config
from
'
../../../config/index.js
'
;
import
upload
from
'
../../components/qn-upload.vue
'
;
import
api
from
'
../../services/apis/offcialLanding
'
;
const
qiniuHost
=
config
.
qiniuHost
;
export
default
{
components
:
{
upload
,
},
computed
:
{
isUpload
:
function
()
{
return
!
(
this
.
upImgUri
.
length
&&
this
.
downImgUri
.
length
);
},
},
data
()
{
return
{
qiniuHost
,
upImgUri
:
[],
downImgUri
:
[],
uploadSuccess
:
false
,
preview
:
{},
isPreview
:
false
,
id
:
0
,
};
},
methods
:
{
async
onSure
()
{
const
params
=
{
upImgUri
:
this
.
upImgUri
[
0
],
downImgUri
:
this
.
downImgUri
[
0
]
};
try
{
if
(
this
.
id
)
{
await
api
.
update
({
...
params
,
id
:
this
.
id
});
}
else
{
await
api
.
submit
(
params
);
}
this
.
uploadSuccess
=
true
;
this
.
upImgUri
=
[];
this
.
downImgUri
=
[];
}
catch
(
err
)
{
console
.
log
(
err
);
this
.
uploadSuccess
=
false
;
}
},
async
showPreview
()
{
this
.
isPreview
=
false
;
const
res
=
await
api
.
getImg
();
this
.
preview
.
upimg
=
res
.
upImgUri
;
this
.
preview
.
downimg
=
res
.
downImgUri
;
this
.
isPreview
=
true
;
},
},
mounted
()
{
api
.
getImg
().
then
(
res
=>
{
this
.
id
=
res
.
id
||
null
;
this
.
preview
.
upimg
=
res
.
upImgUri
;
this
.
preview
.
downimg
=
res
.
downImgUri
;
this
.
isPreview
=
true
;
});
},
};
</
script
>
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