Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
2b9d5df6
Commit
2b9d5df6
authored
5 years ago
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动模板删除&活动一些细节调整
parent
7dd47b2e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
181 additions
and
85 deletions
+181
-85
active.js
wx_application/src/api/active.js
+11
-0
Foundation.js
wx_application/src/utils/Foundation.js
+0
-4
activeDetail.vue
wx_application/src/views/active/activeDetail.vue
+97
-46
activeList.vue
wx_application/src/views/active/activeList.vue
+2
-1
createActive.vue
wx_application/src/views/active/createActive.vue
+34
-21
createBigWheelActive.vue
wx_application/src/views/active/createBigWheelActive.vue
+16
-5
index.vue
wx_application/src/views/mainSale/active/template/index.vue
+21
-8
No files found.
wx_application/src/api/active.js
View file @
2b9d5df6
...
...
@@ -122,3 +122,14 @@ export function getTemplateData(id) {
method
:
'post'
})
}
/**
* 删除模板
* @param {} id 模板id
*/
export
function
deleteTemplate
(
id
)
{
return
request
({
url
:
`template/delete?id=
${
id
}
`
,
method
:
'delete'
})
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
wx_application/src/utils/Foundation.js
View file @
2b9d5df6
...
...
@@ -14,10 +14,6 @@ export function CoutDown(Endtime) {
if
(
days
>=
0
||
hours
>=
0
||
minutes
>=
0
||
seconds
>=
0
)
{
document
.
getElementById
(
"timer"
).
innerHTML
=
days
+
"天"
+
hours
+
"小时"
+
minutes
+
"分"
+
seconds
+
"秒"
;
}
if
(
days
<=
0
||
hours
<=
0
)
{
console
.
log
(
'已结束'
);
document
.
getElementById
(
"timer"
).
innerHTML
=
'已结束'
}
function
checkTime
(
i
)
{
//将0-9的数字前面加上0,例1变为01
if
(
i
<
10
)
{
i
=
"0"
+
i
;
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/active/activeDetail.vue
View file @
2b9d5df6
...
...
@@ -14,7 +14,10 @@
</div>
<div
class=
"other"
>
<p>
满
{{
couponDetail
.
salesUnit
}}
元可用
</p>
<p>
有效期:
<span
style=
"font-size: 12px;"
>
{{
couponDetail
.
end_date
}}
</span></p>
<p>
有效期:
<span
style=
"font-size: 12px;"
>
{{
couponDetail
.
end_date
}}
</span>
</p>
<p>
{{
couponDetail
.
deptId
}}
号店通用
</p>
</div>
</div>
...
...
@@ -28,7 +31,7 @@
<div
class=
"wheel"
>
<div
class=
"wheel-point"
@
click=
"Start_Game"
></div>
<img
src=
"../../../public/img/wheel.png"
alt=
"wheel"
/>
<
div
class=
"circle"
></div
>
<
!--
<div
class=
"circle"
></div>
--
>
<div
class=
"wheel-bg"
:class=
"
{freeze: freeze}"
...
...
@@ -50,13 +53,15 @@
</div>
</div>
<div
class=
"awards"
>
<ul>
<li>
<span>
{{
prizeDesc
}}
</span>
<!--
<span>
一等奖:
</span>
<span>
价值280元的优惠券
</span>
-->
</li>
</ul>
<van-field
class=
"area"
v-model=
"prizeDesc"
rows=
"2"
autosize
type=
"textarea"
show-word-limit
:disabled=
"false"
/>
</div>
<div
class=
"time-line"
>
距离结束仅剩
...
...
@@ -76,6 +81,16 @@
<van-overlay
:show=
"showAward && !res_error"
@
click=
"showAward = false"
>
<div
class=
"wrapper"
@
click
.
stop
>
<div
v-if=
"isAward"
class=
"block"
>
<div
class=
"award-coupon"
>
<img
class=
"bg_img"
src=
"/img/coupon.png"
alt=
"coupon"
/>
<div
class=
"other"
>
<p>
{{ awardGood.coupon.type }}
</p>
<div
class=
"split"
>
<img
src=
"../../../public/img/split.png"
alt=
"split"
/>
</div>
<p>
{{ awardGood.coupon.unit }}元
</p>
</div>
</div>
<p
style=
"font-size: 20px;font-weight: bold;"
>
OLAY全场通用抵扣券
</p>
<p
style=
"font-size: 20px;font-weight: bold;"
>
{{ awardGood.prizeName }}!
</p>
<p
style=
"font-size: 20px;font-weight: bold;"
>
恭喜您中奖!
</p>
...
...
@@ -176,7 +191,6 @@ export default {
if
(
this
.
$route
.
query
.
unionid
===
undefined
)
{
this
.
getUnionid
();
}
else
{
console
.
log
(
"有unionid"
);
this
.
userBaseInfo
.
unionid
=
JSON
.
stringify
(
this
.
$route
.
query
.
unionid
);
this
.
userBaseInfo
.
openid
=
JSON
.
stringify
(
this
.
$route
.
query
.
openid
);
let
params
=
{
...
...
@@ -196,16 +210,6 @@ export default {
mounted
()
{
this
.
getAgentAuth
();
this
.
GET_DetailById
(
this
.
active_id
);
let
cur_date
=
new
Date
();
let
end_time
=
new
Date
(
this
.
timeLine
);
if
(
end_time
-
cur_date
>
0
)
{
this
.
timer
=
setInterval
(()
=>
{
CoutDown
(
this
.
timeLine
);
},
1000
);
}
else
{
document
.
getElementById
(
"timer"
).
innerHTML
=
'已结束'
;
this
.
game_end
=
true
;
}
},
watch
:
{
prizeNumber
()
{
...
...
@@ -223,14 +227,20 @@ export default {
}
},
methods
:
{
// 领取
// 领取
(
handleGet
()
{
if
(
this
.
$route
.
query
.
iswxClient
===
"false"
)
{
this
.
$toast
(
"企业微信端不能领取"
);
return
;
}
let
params
=
{
couponId
:
this
.
awardGood
.
activityPrize
?
this
.
awardGood
.
activityPrize
.
couponId
:
this
.
couponDetail
.
id
,
couponId
:
this
.
awardGood
.
activityPrize
?
this
.
awardGood
.
coupon
.
id
:
this
.
couponDetail
.
id
,
unionId
:
this
.
userBaseInfo
.
unionid
,
vipId
:
this
.
userBaseInfo
.
vipId
};
console
.
log
(
'领取'
,
params
);
console
.
log
(
"领取"
,
params
);
APi_Active
.
collectMyCoupon
(
params
).
then
(
res
=>
{
this
.
showAward
=
false
;
this
.
$toast
(
...
...
@@ -250,14 +260,31 @@ export default {
8
)}
`
+
time
.
substring
(
8
);
this
.
prizeListOrigin
=
res
.
data
.
list
;
this
.
prizeNumber
=
res
.
data
.
list
.
length
;
if
(
this
.
active_type
===
"coupon"
)
{
let
time2
=
res
.
data
.
coupon
.
end_date
;
res
.
data
.
coupon
.
end_date
=
`
${
time2
.
substring
(
0
,
4
)}
-
${
time2
.
substring
(
4
,
6
)}
-
${
time2
.
substring
(
6
,
8
)}
`
+
time2
.
substring
(
8
);
res
.
data
.
coupon
.
end_date
=
`
${
time2
.
substring
(
0
,
4
)}
-
${
time2
.
substring
(
4
,
6
)}
-
${
time2
.
substring
(
6
,
8
)}
`
+
time2
.
substring
(
8
);
this
.
couponDetail
=
res
.
data
.
coupon
;
}
if
(
this
.
active_type
===
"wheel"
)
{
let
cur_date
=
new
Date
();
let
end_time
=
new
Date
(
this
.
timeLine
);
console
.
log
(
cur_date
);
console
.
log
(
end_time
);
if
(
end_time
-
cur_date
>
0
)
{
this
.
timer
=
setInterval
(()
=>
{
CoutDown
(
this
.
timeLine
);
},
1000
);
}
else
{
document
.
getElementById
(
"timer"
).
innerHTML
=
"已结束"
;
this
.
game_end
=
true
;
}
}
});
},
handleCheckAuth
()
{
this
.
showAuthDialog
=
false
;
...
...
@@ -270,11 +297,14 @@ export default {
window
.
location
.
href
=
`http://wxsyls.oysd.cn/getwxuserinfo.aspx?jump=
${
redirect_uri
}
`
;
},
Start_Game
()
{
if
(
this
.
$route
.
query
.
iswxClient
===
"false"
)
{
this
.
$toast
(
"企业微信端不能参与抽奖活动"
);
return
;
}
if
(
this
.
game_end
)
{
this
.
$toast
(
'活动已结束'
);
this
.
$toast
(
"活动已结束"
);
return
;
}
console
.
log
(
"会员基本信息"
,
this
.
userBaseInfo
);
if
(
!
this
.
userBaseInfo
.
vipId
)
{
this
.
$toast
(
"非会员,"
);
let
url
=
"http://oysales.oywanhao.com/register"
;
...
...
@@ -288,12 +318,12 @@ export default {
unionId
:
this
.
userBaseInfo
.
unionid
,
userName
:
this
.
userBaseInfo
.
name
};
console
.
log
(
"params"
,
params
);
if
(
this
.
rolling
)
return
;
if
(
this
.
rolling
)
{
this
.
$toast
(
"抽奖中,请勿多次点击!"
);
return
;
}
APi_Active
.
play
(
params
)
.
then
(
res
=>
{
// const random = parseInt(6 * Math.random(0, 5));
console
.
log
(
"抽奖结果"
,
res
.
data
);
if
(
!
res
.
data
.
prizedId
)
{
this
.
res_error
=
true
;
this
.
$toast
(
res
.
data
.
message
);
...
...
@@ -301,16 +331,15 @@ export default {
}
const
{
wheelDeg
,
prizeList
}
=
this
;
this
.
rolling
=
true
;
const
random
=
prizeList
.
map
(
item
=>
item
.
id
)
.
indexOf
(
res
.
data
.
prizeId
);
const
random
=
prizeList
.
map
(
item
=>
item
.
id
).
indexOf
(
res
.
data
.
prizedId
);
this
.
wheelDeg
=
wheelDeg
-
(
wheelDeg
%
360
)
+
6
*
360
-
(
360
/
prizeList
.
length
)
*
random
;
setTimeout
(()
=>
{
this
.
awardGood
=
res
.
data
;
this
.
awardGood
=
prizeList
[
random
];
this
.
awardGood
.
coupon
=
JSON
.
parse
(
this
.
awardGood
.
coupon
);
this
.
rolling
=
false
;
this
.
showAward
=
true
;
this
.
isAward
=
res
.
data
.
prizeName
!==
"谢谢惠顾"
;
...
...
@@ -528,13 +557,10 @@ export default {
.awards
{
width
:
80%
;
min-height
:
100px
;
background
:
#ff9
;
margin
:
0
auto
10px
;
.van-cell
{
background
:
#ff9
;
border-radius
:
10px
;
li
{
padding
:
10px
20px
;
font-size
:
0
.5rem
;
font-weight
:
bold
;
}
}
...
...
@@ -607,7 +633,32 @@ export default {
align-items
:
center
;
flex-direction
:
column
;
width
:
70%
;
padding
:
10px
0
;
background-color
:
#fff
;
.award-coupon
{
position
:
relative
;
width
:
80%
;
.bg_img
{
width
:
100%
;
height
:
100%
;
}
.other
{
display
:
flex
;
justify-content
:
space-between
;
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
width
:
90%
;
height
:
60%
;
margin
:
auto
;
color
:
#f00
;
p
{
margin
:
0
;
}
}
}
p
{
margin-bottom
:
8px
;
}
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/active/activeList.vue
View file @
2b9d5df6
...
...
@@ -127,7 +127,8 @@ export default {
path
:
"/activeDetail"
,
query
:
{
id
:
active_id
,
active_type
:
type
active_type
:
type
,
iswxClient
:
'false'
}
});
}
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/active/createActive.vue
View file @
2b9d5df6
...
...
@@ -107,7 +107,7 @@
/>
</van-cell-group>
<!-- 活动描述 -->
<
div
class=
"detail"
>
<
van-cell
:required=
"true"
class=
"detail"
>
<div
class=
"border"
>
<div
class=
"des"
>
活动描述
</div>
<van-field
...
...
@@ -120,7 +120,7 @@
show-word-limit
/>
</div>
</
div
>
</
van-cell
>
<!-- 活动图片 -->
<div
class=
"detail"
style=
"margin-top:0;"
>
<div
class=
"des"
>
活动图片
</div>
...
...
@@ -140,7 +140,7 @@ export default {
checked_coupon
:
{},
logo_imgs
:
[],
bg_imgs
:
[],
title
:
"
送券
"
,
title
:
""
,
title2
:
""
,
coupon
:
""
,
newCustomer
:
""
,
...
...
@@ -151,23 +151,19 @@ export default {
cashCoupon
:
""
,
limit
:
""
,
startTime
:
new
Date
(),
startTime1
:
"
2020-04-09 08:25:25
"
,
startTime1
:
""
,
endTime
:
new
Date
(),
endTime1
:
"
2020-04-10 08:25:25
"
,
endTime1
:
""
,
startShow
:
false
,
endShow
:
false
,
message
:
"
123
"
,
message
:
""
,
fileList
:
[],
fileList_show
:
[],
showCoupon
:
false
,
coupons
:
[
{
name
:
"选项"
},
{
name
:
"选项"
},
{
name
:
"选项"
,
subname
:
"描述信息"
}
],
maxNumber
:
"1"
,
coupons
:
[],
maxNumber
:
""
,
maxNumber_show
:
false
,
totalLimit
:
"
2
"
,
totalLimit
:
""
,
totalLimit_show
:
false
};
},
...
...
@@ -191,10 +187,8 @@ export default {
this
.
logo_imgs
[
0
]
=
{
url
:
res
.
data
.
activityInfo
.
logo
};
this
.
maxNumber
=
res
.
data
.
activityInfo
.
joinLimit
?.
toString
();
this
.
totalLimit
=
res
.
data
.
activityInfo
.
totalLimit
?.
toString
();
this
.
checked_coupon
=
{
id
:
res
.
data
.
activityInfo
.
couponId
,
name
:
res
.
data
.
activityInfo
.
couponName
}
this
.
checked_coupon
=
JSON
.
parse
(
res
.
data
.
activityInfo
.
coupon
);
this
.
checked_coupon
.
couponId
=
res
.
data
.
activityInfo
.
couponId
;
this
.
message
=
res
.
activityInfo
.
des
;
let
imgs
=
JSON
.
parse
(
res
.
data
.
activityInfo
.
image
);
let
img_list
=
[];
...
...
@@ -207,12 +201,10 @@ export default {
});
},
onSelect
(
val
)
{
console
.
log
(
val
);
this
.
checked_coupon
=
val
;
this
.
showCoupon
=
false
;
},
afterImgRead
(
file
)
{
console
.
log
(
"image"
);
if
(
file
.
length
)
{
file
.
forEach
(
e
=>
{
let
params
=
new
FormData
();
...
...
@@ -233,9 +225,17 @@ export default {
}
},
getCoupons
()
{
console
.
log
(
'获取优惠券'
);
let
id
=
sessionStorage
.
getItem
(
"oyStallCode"
)
||
1
;
API_Active
.
getAllCouponsByOyStallCode
(
id
).
then
(
res
=>
{
if
(
res
.
data
.
length
===
0
||
!
res
.
data
.
length
)
{
this
.
$toast
(
'您所在店铺没有优惠券,请先去创建'
);
setTimeout
(()
=>
{
this
.
$router
.
push
(
'/'
);
},
500
);
}
else
{
this
.
coupons
=
res
.
data
;
}
});
},
async
afterLogoRead
(
file
)
{
...
...
@@ -266,6 +266,19 @@ export default {
return
urls
;
},
handleCreate
()
{
if
(
this
.
title
===
''
||
this
.
startTime1
==
''
||
this
.
endTime1
==
''
||
this
.
logo_imgs
.
length
==
0
||
this
.
maxNumber
==
''
||
this
.
totalLimit
==
''
||
this
.
checked_coupon
==
{}
||
this
.
message
==
''
)
{
this
.
$toast
(
'请完整填写活动表单!'
);
return
;
}
if
(
new
Date
(
this
.
startTime1
)
>=
new
Date
(
this
.
endTime1
))
{
this
.
$toast
(
"活动开始时间应小于活动开始时间"
);
return
;
...
...
@@ -284,7 +297,7 @@ export default {
joinLimit
:
Number
(
this
.
maxNumber
),
// 总发放数量
totalLimit
:
Number
(
this
.
totalLimit
),
coupon
Name
:
this
.
checked_coupon
.
name
,
coupon
:
JSON
.
stringify
(
this
.
checked_coupon
)
,
couponId
:
this
.
checked_coupon
.
id
,
des
:
this
.
message
,
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/active/createBigWheelActive.vue
View file @
2b9d5df6
...
...
@@ -419,10 +419,7 @@ export default {
item
.
limit
=
p
.
personLimit
?.
toString
();
item
.
probability
=
p
.
probability
?.
toString
();
item
.
preLimit
=
p
.
limitReceive
?.
toString
();
this
.
checked_coupon
=
{
id
:
p
.
couponId
,
name
:
p
.
couponName
};
this
.
checked_coupon
=
JSON
.
parse
(
p
.
coupon
);
prizes
.
push
(
item
);
});
this
.
prizeList
=
prizes
;
...
...
@@ -496,6 +493,20 @@ export default {
// console.log(val);
},
handleCreate
()
{
if
(
this
.
basicInfo
.
title
==
''
||
this
.
basicInfo
.
startTime1
==
''
||
this
.
basicInfo
.
endTime1
==
''
||
this
.
logo_imgs
.
length
==
0
||
this
.
basicInfo
.
jointimes
==
''
||
this
.
basicInfo
.
total_join
==
''
||
this
.
message
==
''
||
this
.
prize_produce
==
''
)
{
this
.
$toast
(
'请完整填写表单!'
);
return
;
}
if
(
new
Date
(
this
.
basicInfo
.
startTime1
)
>=
new
Date
(
this
.
basicInfo
.
endTime1
)
)
{
...
...
@@ -520,7 +531,7 @@ export default {
total_probability
+=
Number
(
p
.
probability
);
temp
.
limitReceive
=
p
.
preLimit
;
temp
.
couponId
=
p
.
checked_coupon
.
id
;
temp
.
coupon
Name
=
p
.
checked_coupon
.
name
;
temp
.
coupon
=
JSON
.
stringify
(
p
.
checked_coupon
)
;
params_prizeList
.
push
(
temp
);
});
if
(
total_probability
!=
100
)
{
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/mainSale/active/template/index.vue
View file @
2b9d5df6
<
template
>
<div
class=
"lists"
>
<div
v-for=
"(item, index) of active"
:key=
"index"
>
<van-swipe-cell>
<div
class=
"list"
@
click=
"listClick(index, item)"
>
<div
class=
"list-logos"
>
<img
class=
"list-logo"
:src=
"item.logo"
/>
...
...
@@ -10,6 +11,10 @@
<div
class=
"list-dsc"
>
{{
item
.
des
}}
</div>
</div>
</div>
<template
#
right
v-if=
"index > 1"
>
<van-button
square
type=
"danger"
text=
"删除"
@
click=
"deleteTemplate(item.id, index)"
/>
</
template
>
</van-swipe-cell>
</div>
<span
class=
"more"
v-if=
"active.length && !list_finished"
@
click=
"handleMore"
>
查看更多
...
...
@@ -53,6 +58,14 @@ export default {
this
.
getTemplate
(
this
.
params
);
},
methods
:
{
deleteTemplate
(
tem_id
,
index
)
{
API_Active
.
deleteTemplate
(
id
).
then
(
res
=>
{
if
(
res
.
result
===
'success'
)
{
this
.
active
.
splice
(
index
,
1
);
this
.
$toast
(
'删除成功!'
);
}
})
},
handleMore
()
{
this
.
params
.
pageNo
+=
1
;
this
.
getTemplate
(
this
.
params
);
...
...
This diff is collapsed.
Click to expand it.
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