Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
xulili
ybf
Commits
76a5cd1d
Commit
76a5cd1d
authored
Apr 15, 2020
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加活动列表删除
parent
3732acb8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
34 deletions
+67
-34
active.js
wx_application/src/api/active.js
+11
-0
activeDetail.vue
wx_application/src/views/active/activeDetail.vue
+2
-2
activeList.vue
wx_application/src/views/active/activeList.vue
+51
-29
createActive.vue
wx_application/src/views/active/createActive.vue
+1
-1
createBigWheelActive.vue
wx_application/src/views/active/createBigWheelActive.vue
+1
-1
index.vue
wx_application/src/views/mainSale/active/template/index.vue
+1
-1
No files found.
wx_application/src/api/active.js
View file @
76a5cd1d
...
...
@@ -14,6 +14,17 @@ export function createActive(params) {
})
}
/**
* 删除活动
* @param {*} id 活动id
*/
export
function
deleteActive
(
id
)
{
return
request
({
url
:
`activity/delete?id=
${
id
}
`
,
method
:
'delete'
})
}
/**
* 获取活动列表
*/
...
...
wx_application/src/views/active/activeDetail.vue
View file @
76a5cd1d
...
...
@@ -15,7 +15,7 @@
<div
class=
"other"
>
<p>
满
{{
couponDetail
.
salesUnit
}}
元可用
</p>
<p>
有效期:
有效期
至
:
<span
style=
"font-size: 12px;"
>
{{
couponDetail
.
end_date
}}
</span>
</p>
<p>
{{
couponDetail
.
deptId
}}
号店通用
</p>
...
...
@@ -189,7 +189,7 @@ export default {
if
(
!
sessionStorage
.
getItem
(
"userId"
))
{
// 1.获取code
if
(
this
.
$route
.
query
.
unionid
===
undefined
)
{
this
.
getUnionid
();
//
this.getUnionid();
}
else
{
this
.
userBaseInfo
.
unionid
=
JSON
.
stringify
(
this
.
$route
.
query
.
unionid
);
this
.
userBaseInfo
.
openid
=
JSON
.
stringify
(
this
.
$route
.
query
.
openid
);
...
...
wx_application/src/views/active/activeList.vue
View file @
76a5cd1d
...
...
@@ -5,12 +5,8 @@
</div>
<div
class=
"active"
>
<template
v-for=
"(item, index) in wheelList"
>
<div
v-if=
"index
<
wheelActive
_limit
"
class=
"list"
:key=
"item.id"
@
click=
"toDetail(item.id, item.activityType)"
>
<van-swipe-cell
v-if=
"index
<
wheelActive
_limit
"
:key=
"item.id"
>
<div
class=
"list"
@
click=
"toDetail(item.id, item.activityType)"
>
<div
class=
"left"
>
<img
:src=
"item.logo"
alt=
"logo"
style=
"width:100%;height:100%;"
/>
</div>
...
...
@@ -19,6 +15,10 @@
<p>
{{
item
.
des
}}
</p>
</div>
</div>
<template
#
right
v-if=
"flag == 1"
>
<van-button
square
type=
"danger"
text=
"删除"
@
click=
"deleteWheelAct(item.id, index)"
/>
</
template
>
</van-swipe-cell>
</template>
<span
class=
"more"
...
...
@@ -32,7 +32,8 @@
<div
v-if=
"couponList.length > 0"
class=
"fg"
>
送券活动
</div>
<div
class=
"active"
>
<
template
v-for=
"(item, index) in couponList"
>
<div
v-if=
"index
<
couponActive
_limit
"
class=
"list"
:key=
"item.id"
@
click=
"toDetail(item.id, item.activityType)"
>
<van-swipe-cell
v-if=
"index
<
couponActive
_limit
"
:key=
"item.id"
>
<div
class=
"list"
@
click=
"toDetail(item.id, item.activityType)"
>
<div
class=
"left"
>
<img
:src=
"item.logo"
alt=
"logo"
style=
"width:100%;height:100%;"
/>
</div>
...
...
@@ -41,6 +42,10 @@
<p>
{{
item
.
des
}}
</p>
</div>
</div>
<template
#
right
v-if=
"flag == 1"
>
<van-button
square
type=
"danger"
text=
"删除"
@
click=
"deleteCouponAct(item.id, index)"
/>
</
template
>
</van-swipe-cell>
</template>
<span
class=
"more"
...
...
@@ -59,6 +64,7 @@ import * as API_Active from "@/api/active";
export
default
{
data
()
{
return
{
flag
:
1
,
wheelActive_limit
:
3
,
wheelList_finished
:
false
,
couponActive_limit
:
3
,
...
...
@@ -78,20 +84,37 @@ export default {
mounted
()
{
this
.
getWheelActive
();
this
.
getCouponActive
();
// this.flag = sessionStorage.getItem("role");
},
methods
:
{
deleteCouponAct
(
id
,
index
)
{
API_Active
.
deleteActive
(
id
).
then
(
res
=>
{
if
(
res
.
result
===
"success"
)
{
this
.
wheelList
.
splice
(
index
,
1
);
this
.
$toast
(
"删除成功!"
);
}
});
},
deleteWheelAct
(
id
,
index
)
{
API_Active
.
deleteActive
(
id
).
then
(
res
=>
{
if
(
res
.
result
===
"success"
)
{
this
.
wheelList
.
splice
(
index
,
1
);
this
.
$toast
(
"删除成功!"
);
}
});
},
async
getCouponActive
()
{
let
res
=
await
this
.
getActiveList
(
"coupon"
);
this
.
couponList
.
push
.
apply
(
this
.
couponList
,
res
.
data
.
list
);
if
(
res
.
data
.
list
===
[])
{
this
.
couponList_finished
=
true
this
.
couponList_finished
=
true
;
}
},
async
getWheelActive
()
{
let
res
=
await
this
.
getActiveList
(
"wheel"
);
this
.
wheelList
.
push
.
apply
(
this
.
wheelList
,
res
.
data
.
list
);
if
(
res
.
data
.
list
===
[])
{
this
.
wheelList_finished
=
true
this
.
wheelList_finished
=
true
;
}
},
handleActiveMore
(
type
)
{
...
...
@@ -102,16 +125,15 @@ export default {
}
else
if
(
type
===
"coupon"
)
{
this
.
couponActive_limit
+=
3
;
this
.
coupon_params
.
pageNo
+=
1
;
this
.
getCouponActive
()
this
.
getCouponActive
()
;
}
},
// 获取 活动列表
async
getActiveList
(
type
)
{
let
page_params
=
{};
if
(
type
===
'wheel'
)
{
if
(
type
===
"wheel"
)
{
page_params
=
this
.
wheel_params
;
}
else
if
(
type
===
'coupon'
)
{
}
else
if
(
type
===
"coupon"
)
{
page_params
=
this
.
coupon_params
;
}
let
params
=
{
...
...
@@ -128,7 +150,7 @@ export default {
query
:
{
id
:
active_id
,
active_type
:
type
,
iswxClient
:
'false'
iswxClient
:
"false"
}
});
}
...
...
wx_application/src/views/active/createActive.vue
View file @
76a5cd1d
...
...
@@ -172,7 +172,7 @@ export default {
};
},
created
()
{
this
.
minStartDate
=
new
Date
(
);
this
.
minStartDate
=
new
Date
(
(
new
Date
()
/
1000
+
3600
)
*
1000
)
this
.
minEndDate
=
new
Date
((
new
Date
()
/
1000
+
86400
)
*
1000
);
},
methods
:
{
...
...
wx_application/src/views/active/createBigWheelActive.vue
View file @
76a5cd1d
...
...
@@ -351,7 +351,7 @@ export default {
};
},
created
()
{
this
.
minStartDate
=
new
Date
();
this
.
minStartDate
=
new
Date
(
(
new
Date
()
/
1000
+
3600
)
*
1000
);
this
.
minEndDate
=
new
Date
((
new
Date
()
/
1000
+
86400
)
*
1000
);
},
methods
:
{
...
...
wx_application/src/views/mainSale/active/template/index.vue
View file @
76a5cd1d
...
...
@@ -59,7 +59,7 @@ export default {
},
methods
:
{
deleteTemplate
(
tem_id
,
index
)
{
API_Active
.
deleteTemplate
(
id
).
then
(
res
=>
{
API_Active
.
deleteTemplate
(
tem_
id
).
then
(
res
=>
{
if
(
res
.
result
===
'success'
)
{
this
.
active
.
splice
(
index
,
1
);
this
.
$toast
(
'删除成功!'
);
...
...
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