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
02b105b7
Commit
02b105b7
authored
Apr 29, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
03ca4cea
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
198 additions
and
15 deletions
+198
-15
pointDetail.js
src/pages/pointDetail/pointDetail.js
+1
-0
couponCenter.js
src/subPackage/page/pages/couponCenter/couponCenter.js
+83
-1
couponCenter.wxml
src/subPackage/page/pages/couponCenter/couponCenter.wxml
+1
-1
couponCenterInfo.js
...ubPackage/page/pages/couponCenterInfo/couponCenterInfo.js
+97
-2
couponCenterInfo.wxml
...Package/page/pages/couponCenterInfo/couponCenterInfo.wxml
+5
-5
couponCenterInfo.wxss
...Package/page/pages/couponCenterInfo/couponCenterInfo.wxss
+8
-3
valueCardInfo.js
src/subPackage/page/pages/valueCardInfo/valueCardInfo.js
+3
-3
No files found.
src/pages/pointDetail/pointDetail.js
View file @
02b105b7
...
...
@@ -56,6 +56,7 @@ wxService.page({
isAuthorization
:
false
},
()
=>
{
const
option
=
this
.
options
||
{}
const
{
scene
}
=
option
if
(
scene
)
{
let
idParam
=
decodeURIComponent
(
scene
).
split
(
'&'
)[
0
]
...
...
src/subPackage/page/pages/couponCenter/couponCenter.js
View file @
02b105b7
// pages/userCenter.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
wxService
.
page
({
/**
* 页面的初始数据
...
...
@@ -8,6 +8,7 @@ wxService.page({
data
:
{
query
:
''
,
integralCouponList
:
[],
// 积分兑换优惠券列表
userHasBaseInfo
:
false
,
},
/**
...
...
@@ -16,6 +17,67 @@ wxService.page({
onLoad
:
function
(
options
)
{
wx
.
hideShareMenu
();
this
.
initIntegralCouponList
();
this
.
userHasLogin
();
},
//授权
_getUserInfo
(
res
=
{})
{
const
userInfo
=
res
.
detail
||
{}
if
(
res
.
detail
.
userInfo
)
{
utils
.
getUserInfoByBtn
(
userInfo
).
then
((
data
=
{})
=>
{
const
{
token
}
=
data
wx
.
setStorageSync
(
'_accreditUserInfo'
,
userInfo
)
if
(
token
)
{
wx
.
setStorageSync
(
'token'
,
token
)
}
else
{
wx
.
setStorageSync
(
'token'
,
''
)
}
wx
.
setStorageSync
(
'_baseUserInfo'
,
data
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前会员是否是体验者
const
{
member
}
=
baseUserInfo
const
curMemberTrial
=
member
&&
member
.
trial
||
false
wx
.
setStorageSync
(
'isExperiencer'
,
curMemberTrial
)
this
.
setUserInfo
()
}).
catch
(
err
=>
{
if
(
err
)
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
})
}
},
//获取当前用户是否登录
userHasLogin
(){
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
baseUserInfo
){
this
.
setData
({
userHasBaseInfo
:
true
})
}
else
{
this
.
setData
({
userHasBaseInfo
:
false
})
}
},
setUserInfo
()
{
// 判断有无开卡
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 新用户去激活领卡
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
&&
!
userInfo
.
member
.
cardNoWeixin
)
{
wxService
.
openCard
()
return
false
}
// 跳转
setTimeout
(()
=>
{
this
.
initIntegralCouponList
();
this
.
userHasLogin
();
},
200
)
},
// 获取优惠券活动列表
...
...
@@ -49,6 +111,26 @@ wxService.page({
},
//立即兑换优惠券
exchange
(
e
)
{
const
{
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
member
){
wx
.
showToast
({
title
:
'请先去登录'
,
icon
:
'none'
})
return
;
}
//判断是否开卡
if
(
!
member
.
cardNoWeixin
){
wx
.
showToast
({
title
:
'请先开卡后购买'
,
icon
:
'none'
});
wxService
.
openCard
()
return
;
}
wx
.
showLoading
({
title
:
'领取中..'
,
});
...
...
src/subPackage/page/pages/couponCenter/couponCenter.wxml
View file @
02b105b7
...
...
@@ -23,7 +23,7 @@
</view>
</view>
<view class='coupon-btn positionRe'>
<button wx:if="{{!
currentHasUser
Info}}"
<button wx:if="{{!
userHasBase
Info}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo'
class="clear-btn positionAbs"></button>
...
...
src/subPackage/page/pages/couponCenterInfo/couponCenterInfo.js
View file @
02b105b7
// subPackage/page/pages/couponCenterInfo/couponCenterInfo.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
wxService
.
page
({
/**
...
...
@@ -7,7 +8,9 @@ wxService.page({
*/
data
:
{
activityId
:
null
,
activityInfo
:
{}
activityInfo
:
{},
userHasBaseInfo
:
false
,
isLoading
:
true
,
},
/**
...
...
@@ -17,6 +20,7 @@ wxService.page({
let
id
=
options
.
id
;
this
.
data
.
activityId
=
id
;
this
.
getACtivityInfo
();
this
.
userHasLogin
();
},
/**
...
...
@@ -26,6 +30,66 @@ wxService.page({
},
//授权
_getUserInfo
(
res
=
{})
{
const
userInfo
=
res
.
detail
||
{}
if
(
res
.
detail
.
userInfo
)
{
utils
.
getUserInfoByBtn
(
userInfo
).
then
((
data
=
{})
=>
{
const
{
token
}
=
data
wx
.
setStorageSync
(
'_accreditUserInfo'
,
userInfo
)
if
(
token
)
{
wx
.
setStorageSync
(
'token'
,
token
)
}
else
{
wx
.
setStorageSync
(
'token'
,
''
)
}
wx
.
setStorageSync
(
'_baseUserInfo'
,
data
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前会员是否是体验者
const
{
member
}
=
baseUserInfo
const
curMemberTrial
=
member
&&
member
.
trial
||
false
wx
.
setStorageSync
(
'isExperiencer'
,
curMemberTrial
)
this
.
setUserInfo
()
}).
catch
(
err
=>
{
if
(
err
)
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
})
}
},
//获取当前用户是否登录
userHasLogin
(){
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
baseUserInfo
){
this
.
setData
({
userHasBaseInfo
:
true
})
}
else
{
this
.
setData
({
userHasBaseInfo
:
false
})
}
},
setUserInfo
()
{
// 判断有无开卡
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 新用户去激活领卡
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
&&
!
userInfo
.
member
.
cardNoWeixin
)
{
wxService
.
openCard
()
return
false
}
// 跳转
setTimeout
(()
=>
{
this
.
getACtivityInfo
();
this
.
userHasLogin
();
},
200
)
},
//获取活动详情
getACtivityInfo
(){
wxService
.
post
(
`/coupon/couponCenterActivity/buyer/getDetail?id=
${
this
.
data
.
activityId
}
`
).
then
(
res
=>
{
...
...
@@ -37,8 +101,14 @@ wxService.page({
obj
.
hasExpDate
=
arr
.
filter
(
item
=>
item
.
type
==
1
).
length
>
0
;
this
.
data
.
activityInfo
=
obj
;
this
.
setData
({
activityInfo
:
this
.
data
.
activityInfo
activityInfo
:
this
.
data
.
activityInfo
,
});
// 定时器为了防止触点那边没有正常返回用户就点击了
setTimeout
(()
=>
{
this
.
setData
({
isLoading
:
false
,
})
},
1000
);
}
}
})
...
...
@@ -46,9 +116,34 @@ wxService.page({
//领取优惠券
onTapGetCoupon
(){
if
(
this
.
data
.
isLoading
){
return
;
}
const
{
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
member
){
wx
.
showToast
({
title
:
'请先去登录'
,
icon
:
'none'
})
return
;
}
//判断是否开卡
if
(
!
member
.
cardNoWeixin
){
wx
.
showToast
({
title
:
'请先开卡后购买'
,
icon
:
'none'
});
wxService
.
openCard
()
return
;
}
wx
.
showLoading
({
title
:
'领取中..'
,
});
let
id
=
this
.
data
.
activityId
;
wxService
.
post
(
`/coupon/couponCenterActivity/buyer/coupon/draw?id=
${
id
}
`
).
then
(
res
=>
{
wx
.
hideLoading
();
...
...
src/subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxml
View file @
02b105b7
...
...
@@ -2,7 +2,7 @@
<view class="coupon-info-con">
<view class="coupon-info-bg" style="background-image:url('https://img3.bigaka.com/prd/3001/202003/20200331/3001df30305c-f4fe-4c35-bd73-5d87d4882f7a.png')">
<view class="lf-coupon-Bg">
<image wx:if="{{activityInfo.listPicture}}" mode="aspectFi
t
" src="{{activityInfo.listPicture}}"></image>
<image wx:if="{{activityInfo.listPicture}}" mode="aspectFi
ll
" src="{{activityInfo.listPicture}}"></image>
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200331/3001649f2f08-3b4e-4b5b-97c1-30cdf646651c.png' />
</view>
<view class="rg-coupon-info">
...
...
@@ -28,12 +28,12 @@
</view>
<!-- 按钮 -->
<view class="get-btn positionRe">
<button wx:if="{{!
currentHasUser
Info}}"
<view class="get-btn positionRe
{{isLoading ? 'btn-disabled' : ''}}
">
<button wx:if="{{!
userHasBase
Info}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo'
class="clear-btn positionAbs">
立即领取
</button>
<view wx:else class="view-btn
" bindtap="onTapGetCoupon">立即领取
</view>
class="clear-btn positionAbs">
{{isLoading ? '数据加载中...' : '立即领取'}}
</button>
<view wx:else class="view-btn
" bindtap="onTapGetCoupon">{{isLoading ? '数据加载中...' : '立即领取'}}
</view>
</view>
</view>
src/subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxss
View file @
02b105b7
...
...
@@ -31,7 +31,7 @@ view{
top: 0;
width: 170rpx;
height: 100%;
padding: 1
5
rpx;
padding: 1
0
rpx;
}
.coupon-info-bg .lf-coupon-Bg image{
...
...
@@ -44,12 +44,14 @@ view{
height: 100%;
padding: 15rpx;
font-size: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.coupon-title{
font-size: 28rpx;
color: #333333;
margin-bottom: 8rpx;
font-weight: 550;
text-overflow: ellipsis;
display: -webkit-box;
...
...
@@ -58,10 +60,13 @@ view{
overflow: hidden;
}
.btn-disabled{
opacity: 0.7;
}
.coupon-date{
font-size: 22rpx;
color: #999999;
margin-bottom: 5rpx;
}
.exp-intro{
...
...
src/subPackage/page/pages/valueCardInfo/valueCardInfo.js
View file @
02b105b7
...
...
@@ -21,15 +21,15 @@ wxService.page({
onLoad
:
function
(
options
)
{
this
.
data
.
id
=
options
.
id
;
wx
.
hideShareMenu
();
this
.
userHasLogin
();
this
.
getValueCardActivityInfo
();
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
userHasLogin
();
},
//获取当前用户是否登录
...
...
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