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
1635f2b4
Commit
1635f2b4
authored
Jun 02, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改字段
parent
1a545d53
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
394 additions
and
1 deletions
+394
-1
app.json
src/app.json
+2
-1
project.config.json
src/project.config.json
+7
-0
activityOrder.js
...ackageMarketing/page/pages/activityOrder/activityOrder.js
+220
-0
activityOrder.json
...kageMarketing/page/pages/activityOrder/activityOrder.json
+6
-0
activityOrder.wxml
...kageMarketing/page/pages/activityOrder/activityOrder.wxml
+32
-0
activityOrder.wxss
...kageMarketing/page/pages/activityOrder/activityOrder.wxss
+127
-0
No files found.
src/app.json
View file @
1635f2b4
...
...
@@ -122,7 +122,8 @@
"pages/scratch/scratch"
,
"pages/scratchRule/scratchRule"
,
"pages/sign/sign"
,
"pages/liveSubscrib/liveSubscrib"
"pages/liveSubscrib/liveSubscrib"
,
"pages/activityOrder/activityOrder"
]
}
],
...
...
src/project.config.json
View file @
1635f2b4
...
...
@@ -729,6 +729,13 @@
"pathName"
:
"subPackageMarketing/page/pages/liveSubscrib/liveSubscrib"
,
"query"
:
"room_id=8"
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"活动预约"
,
"pathName"
:
"subPackageMarketing/page/pages/activityOrder/activityOrder"
,
"query"
:
"id=717451838479273984"
,
"scene"
:
null
}
]
}
...
...
src/subPackageMarketing/page/pages/activityOrder/activityOrder.js
0 → 100644
View file @
1635f2b4
// subPackageMarketing/page/pages/activityOrder/activityOrder.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
let
app
=
getApp
();
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
id
:
''
,
activityInfo
:
{},
orderBtnText
:
'立即预约'
,
userOrderStatus
:
false
,
showInvite
:
false
,
shareObj
:
{
title
:
''
,
path
:
''
,
imageUrl
:
''
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
if
(
options
.
id
){
this
.
data
.
id
=
options
.
id
;
wx
.
showLoading
({
title
:
'数据加载中..'
,
});
this
.
getActivityInfo
();
}
},
//获取活动详情
getActivityInfo
(){
wxService
.
post
(
`/marketing/bookingActivitySet/findById?id=
${
this
.
data
.
id
}
`
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
){
let
obj
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
obj
){
this
.
data
.
activityInfo
=
obj
;
this
.
setData
({
activityInfo
:
this
.
data
.
activityInfo
});
this
.
setUserOrderStatus
(
this
.
data
.
id
);
//生成触点
this
.
generatePoint
();
}
}
})
},
//设置用户预约状态
setUserOrderStatus
(
id
){
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
baseUserInfo
){
this
.
setData
({
currentHasUserInfo
:
false
,
});
return
;
}
this
.
setData
({
currentHasUserInfo
:
true
,
});
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
){
this
.
setData
({
orderBtnText
:
'立即预约'
,
userOrderStatus
:
false
,
});
}
else
{
this
.
setData
({
orderBtnText
:
'已预约'
,
userOrderStatus
:
true
,
});
}
}
});
},
// let enCodeUrl = encodeURIComponent(url);
// let sharePath = `/subPackage/page/pages/h5/h5page?url=${enCodeUrl}`
//立即预约
onTapOrderNow
(){
//先判断是否已经预约过
if
(
this
.
data
.
userOrderStatus
){
wx
.
showModal
({
title
:
'预约成功'
,
showCancel
:
false
,
confirmText
:
'确定'
,
content
:
'您已订阅消息通知~'
,
confirmColor
:
app
.
globalData
.
themeColor
,
success
(){},
})
}
else
{
if
(
this
.
data
.
activityInfo
.
templateId
){
this
.
getOrderActivityInfo
(
this
.
data
.
activityInfo
,
this
.
data
.
activityInfo
);
}
}
},
//获取预约信息
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
=>
{});
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
(
res
)
{
this
.
onTapCloseModal
();
return
this
.
data
.
shareObj
;
},
//生成触点
generatePoint
(){
let
content
=
{
title
:
this
.
data
.
activityInfo
.
name
,
id
:
this
.
data
.
activityInfo
.
id
,
url
:
this
.
data
.
activityInfo
.
imgUrl
}
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
contentId
:
this
.
data
.
activityInfo
.
id
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
PRODUCT_DETAIL
,
//内容类型 STAFF_RECOMMAND
title
:
this
.
data
.
activityInfo
.
name
,
//标题
type
:
2
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
id
)
{
let
tentacleId
=
res
.
id
;
let
inner_id
=
Integer
.
digit
(
this
.
data
.
activityInfo
.
id
,
10
,
64
);
let
inner_tentacleId
=
Integer
.
digit
(
tentacleId
,
10
,
64
);
var
path
=
'subPackage/page/pages/scanCoupon/scanCoupon'
+
'?i='
+
inner_id
+
'&t='
+
inner_tentacleId
;
this
.
data
.
shareObj
=
{
title
:
this
.
data
.
activityInfo
.
name
,
path
:
path
,
imageUrl
:
this
.
data
.
activityInfo
.
imgUrl
}
this
.
setData
({
shareObj
:
this
.
data
.
shareObj
});
}
});
},
//邀请好友
onTapInviteFriends
(){
this
.
setData
({
showInvite
:
true
});
},
//关闭
onTapCloseModal
(){
this
.
setData
({
showInvite
:
false
});
}
})
\ No newline at end of file
src/subPackageMarketing/page/pages/activityOrder/activityOrder.json
0 → 100644
View file @
1635f2b4
{
"disableScroll"
:
true
,
"navigationBarTitleText"
:
"活动预约"
,
"usingComponents"
:
{}
}
\ No newline at end of file
src/subPackageMarketing/page/pages/activityOrder/activityOrder.wxml
0 → 100644
View file @
1635f2b4
<!--subPackageMarketing/page/pages/activityOrder/activityOrder.wxml-->
<view class="page-container">
<image src="{{activityInfo.imgUrl}}" mode="aspectFit"></image>
</view>
<view class="bottom-order">
<view class="order-btns positionRe" >
<button wx:if="{{!currentHasUserInfo}}" class="positionAbs clear-btn" bindgetuserinfo="_getUserInfo" open-type='getUserInfo'></button>
<text bindtap="onTapOrderNow">{{orderBtnText}}</text>
</view>
<view class="order-btns positionRe">
<button wx:if="{{!currentHasUserInfo}}" class="positionAbs clear-btn" bindgetuserinfo="_getUserInfo" open-type='getUserInfo'></button>
<text bindtap="onTapInviteFriends">邀请好友</text>
</view>
</view>
<!-- 底部 -->
<view class="invite-modal" wx:if="{{showInvite}}" bindtap="onTapCloseModal"></view>
<view class="invite-body {{showInvite ? 'show' : ''}}">
<view class="items">
<button open-type="share" class="clear-btn">
<image src="/assets/imgs/7_1_0/wx-icon.png" mode="aspectFit"></image>
<text>微信好友</text>
</button>
</view>
<view class="items">
<button class="clear-btn">
<image src="/assets/imgs/7_1_0/wx-icon.png" mode="aspectFit"></image>
<text>生成海报</text>
</button>
</view>
</view>
\ No newline at end of file
src/subPackageMarketing/page/pages/activityOrder/activityOrder.wxss
0 → 100644
View file @
1635f2b4
/* subPackageMarketing/page/pages/activityOrder/activityOrder.wxss */
page{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.page-container{
width: 100vw;
height: 100vh;
}
.page-container image{
width: 100%;
height: 100%;
}
.bottom-order{
position: fixed;
bottom: 0;
z-index: 1;
left: 0;
width: 100vw;
height: 140rpx;
/* background: var(--themeColorRgba06); */
background: transparent;
padding: 0 30rpx;
display: flex;
align-items: center;
justify-content: space-around;
}
.bottom-order .order-btns{
width: 35vw;
height: 70rpx;
background: var(--themecolor);
color: #ffffff;
font-size: 28rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10rpx;
}
.bottom-order .order-btns:active{
opacity: 0.7;
}
.bottom-order .order-btns text{
flex: 1;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
/* */
.invite-modal{
position: fixed;
z-index: 2;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
transition: all 0.3s;
left: 0;
top: 0;
}
.invite-body{
position: fixed;
z-index: 3;
width: 100vw;
height: 18vh;
background: #ffffff;
transition: all 0.3s;
left: 0;
bottom: 0;
padding: 30rpx;
display: flex;
align-items: center;
justify-content: space-around;
transform: translateY(100%);
}
.invite-body.show{
transform: translateY(0);
}
.invite-body .items{
width: 160rpx;
height: 180rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.invite-body .items button{
appearance: none;
background: transparent;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: none;
padding: 0;
margin: 0;
}
.invite-body .items button::after{
border: none;
}
.invite-body .items image{
width: 80rpx;
height: 80rpx;
}
.invite-body .items:active{
opacity: 0.7;
}
\ No newline at end of file
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