Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
高淑倩
7-Eleven
Commits
1a545d53
Commit
1a545d53
authored
Jun 02, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
53686f54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
3 deletions
+102
-3
imageSwiper.js
src/component/imageSwiper/imageSwiper.js
+89
-2
picNav.js
src/component/picNav/picNav.js
+13
-1
No files found.
src/component/imageSwiper/imageSwiper.js
View file @
1a545d53
...
...
@@ -150,7 +150,94 @@ Component({
},
//预览
preview
(
event
)
{
utilLink
.
currentLinkRouter
(
event
,
this
)
}
let
ret
=
utilLink
.
currentLinkRouter
(
event
,
this
);
if
(
ret
&&
typeof
ret
===
'object'
){
if
(
ret
.
type
==
11
){
this
.
hanlderOrderActivity
(
ret
);
}
}
},
//处理活动预约
hanlderOrderActivity
(
info
){
//判断用户是否已经预约过此活动
this
.
userHasOrderedActivity
(
info
.
id
,
info
);
},
//判断活动是否已经预约过
userHasOrderedActivity
(
id
,
info
){
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
wxService
.
post
(
`/merchant/message/wxSubMsgSubscride/getByParams`
,{
memberId
:
baseUserInfo
.
memberId
,
businessId
:
id
}).
then
(
res
=>
{
if
(
res
){
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
[];
if
(
data
.
length
==
0
){
//未预约
if
(
info
.
templateId
){
this
.
getOrderActivityInfo
(
info
.
templateId
,
info
);
}
}
else
{
wx
.
showModal
({
title
:
'预约成功'
,
showCancel
:
false
,
confirmText
:
'确定'
,
content
:
'您已订阅消息通知~'
,
confirmColor
:
app
.
globalData
.
themeColor
,
success
(){},
})
}
}
})
},
//获取预约活动详情
getOrderActivityInfo
(
id
,
info
){
wxService
.
get
(
`/merchant/message/wxTemplateMappingMiniProgram/
${
id
}
`
).
then
(
res
=>
{
if
(
res
){
let
templateObj
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
templateObj
){
let
templateId
=
templateObj
.
templateId
;
wx
.
requestSubscribeMessage
({
tmplIds
:
[
templateId
],
success
:
(
reqRes
)
=>
{
this
.
orderActivity
(
info
.
id
,
templateId
,
info
);
},
complete
:
(
reqComp
)
=>
{}
})
}
}
});
},
//预约活动
orderActivity
(
activityId
,
templateId
,
info
){
let
self
=
this
;
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
wxService
.
post
(
`
${
'/merchant/message/wxSubMsgSubscride/member/subscribe'
}
`
,
{
businessId
:
activityId
,
memberId
:
baseUserInfo
.
memberId
,
templateId
:
templateId
,
}).
then
(
resp
=>
{
wx
.
showModal
({
title
:
'预约成功'
,
showCancel
:
false
,
confirmText
:
'确定'
,
content
:
info
.
prompt
,
confirmColor
:
app
.
globalData
.
themeColor
,
success
(){
self
.
award
(
activityId
);
},
})
});
},
//发奖接口
award
(
activityId
){
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
wxService
.
post
(
`/marketing/bookingActivitySet/award`
,{
activityId
:
activityId
,
memberId
:
baseUserInfo
.
memberId
,
type
:
0
}).
then
(
res
=>
{});
},
}
})
src/component/picNav/picNav.js
View file @
1a545d53
...
...
@@ -163,6 +163,7 @@ Component({
},
//预约活动
orderActivity
(
activityId
,
templateId
,
info
){
let
self
=
this
;
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
wxService
.
post
(
`
${
'/merchant/message/wxSubMsgSubscride/member/subscribe'
}
`
,
{
businessId
:
activityId
,
...
...
@@ -175,10 +176,21 @@ Component({
confirmText
:
'确定'
,
content
:
info
.
prompt
,
confirmColor
:
app
.
globalData
.
themeColor
,
success
(){},
success
(){
self
.
award
(
activityId
);
},
})
});
},
//发奖接口
award
(
activityId
){
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
wxService
.
post
(
`/marketing/bookingActivitySet/award`
,{
activityId
:
activityId
,
memberId
:
baseUserInfo
.
memberId
,
type
:
0
}).
then
(
res
=>
{});
},
//激活开卡
activeTocard
(
e
)
{
if
(
e
.
detail
)
{
...
...
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