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
f6a05cc3
Commit
f6a05cc3
authored
Aug 19, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:集点详情_授权
parent
bac1b1b1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
295 additions
and
7 deletions
+295
-7
authorization-modal-point.js
...nt/authorization-modal-point/authorization-modal-point.js
+134
-0
authorization-modal-point.json
.../authorization-modal-point/authorization-modal-point.json
+5
-0
authorization-modal-point.wxml
.../authorization-modal-point/authorization-modal-point.wxml
+27
-0
authorization-modal-point.wxss
.../authorization-modal-point/authorization-modal-point.wxss
+88
-0
pointDetail.js
src/pages/pointDetail/pointDetail.js
+37
-6
pointDetail.json
src/pages/pointDetail/pointDetail.json
+3
-1
pointDetail.wxml
src/pages/pointDetail/pointDetail.wxml
+1
-0
No files found.
src/component/authorization-modal-point/authorization-modal-point.js
0 → 100644
View file @
f6a05cc3
const
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
const
envInfo
=
require
(
'../../config/index'
).
envInfo
Component
({
/**
* 组件的属性列表
*/
properties
:
{
isAuthorization
:
Boolean
,
isAuthorizationActiveText
:
{
type
:
String
,
value
:
''
},
isAuthorizationType
:
{
type
:
Number
,
value
:
2
}
},
observers
:
{
},
/**
* 组件的初始数据
*/
data
:
{
couponNum
:
'2'
,
userInfo
:
{},
hasUserInfo
:
false
,
env
:
envInfo
.
env
,
checkAll
:
true
},
/**
* 组件的方法列表
*/
methods
:
{
checkAll
()
{
this
.
setData
({
checkAll
:
!
this
.
data
.
checkAll
})
},
handelToMemberRules
()
{
wxService
.
router
(
`/pages/memberRules/memberRules?type=
${
this
.
data
.
isAuthorizationType
}
`
)
},
//再想想
close
()
{
this
.
setData
({
isAuthorization
:
false
})
},
//立即兑换
query
()
{},
_getUserInfo
(
res
=
{})
{
this
.
setData
({
isAuthorization
:
false
})
const
userInfo
=
res
.
detail
||
{}
if
(
res
.
detail
.
userInfo
)
{
utils
.
getUserInfoByBtn
(
userInfo
).
then
(
(
data
=
{}
)
=>
{
const
{
token
}
=
data
wx
.
setStorageSync
(
'_accreditUserInfo'
,
userInfo
)
wx
.
hideNavigationBarLoading
()
if
(
token
)
{
wx
.
setStorageSync
(
'token'
,
token
)
}
else
{
wx
.
setStorageSync
(
'token'
,
''
)
}
wx
.
setStorageSync
(
'_baseUserInfo'
,
data
)
// 存储用户开卡状态
// wx.setStorageSync('memberActivateStatus', data.memberActivateStatus)
this
.
setUserInfo
()
}).
catch
(
err
=>
{
if
(
err
)
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
})
}
else
{
this
.
setData
({
isAuthorization
:
false
})
}
},
handleActiveAgree
()
{
// 子组件触发父组件 去开卡
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'activeTocard'
,
true
)
})
this
.
setData
({
isAuthorization
:
false
})
},
setUserInfo
()
{
// 判断有无开卡
// const {memberActivateStatus} = wx.getStorageSync('_baseUserInfo')
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 新用户去激活领卡
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
wxService
.
openCard
()
return
false
}
// 没有开卡并且需要开卡
// if(!memberActivateStatus) {
// wxService.openCard()
// return false
// }
// 跳转
const
urls
=
getCurrentPages
()
setTimeout
(()
=>
{
const
item
=
urls
[
0
]
if
(
item
.
route
)
{
try
{
const
options
=
item
.
options
wxService
.
router
(
`/
${
item
.
route
}
`
).
search
(
options
).
replace
()
}
catch
(
e
)
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
}
else
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
},
200
)
}
}
})
src/component/authorization-modal-point/authorization-modal-point.json
0 → 100644
View file @
f6a05cc3
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
src/component/authorization-modal-point/authorization-modal-point.wxml
0 → 100644
View file @
f6a05cc3
<view class="modal" wx:if='{{isAuthorization}}'>
<view class="modal-mask"></view>
<view class="modal-container" style="top:{{isAuthorizationActiveText ? '12%' : '26%' }};">
<view class='auth-avatar'>
<image class='auth-avatar-img' src='/assets/imgs/auth-avatar.png'></image>
</view>
<view class='auth-shop' wx:if="{{isAuthorizationActiveText}}">
<view class="auto-old"><span class="auto-old-num">1. </span>老会员无需领取新会员卡,即可在会员小程序享受全部会员权益。</view>
<view class="auto-old"><span class="auto-old-num">2. </span>若在领取新会员卡过程中输入新手机号,会造成原会员及积分信息的更替。</view>
<view class="auto-old"><span class="auto-old-num">3. </span>领取后的新会员卡,将存放在"微信-卡包"。</view>
</view>
<view class='auth-shop' wx:else>广东7-Eleven申请获取授权,用于会员服务</view>
<button type='primary' wx:if="{{!isAuthorizationActiveText}}" bindgetuserinfo="_getUserInfo" open-type='getUserInfo' class='agree' disabled='{{!checkAll}}'>同意</button>
<button type='primary' wx:else class='agree' disabled='{{!checkAll}}' bindtap="handleActiveAgree">同意并领取新会员卡</button>
<view class='rule-wrap'>
<view class='agree-rule'>
<view wx:if="{{!isAuthorizationActiveText}}" class="agree-icon"><icon size="18" type="{{checkAll ? 'success' : 'circle'}}" bindtap="checkAll"></icon></view>
<view wx:if="{{!isAuthorizationActiveText}}"><text>我已阅读并同意</text><text class='rule-text' bindtap="handelToMemberRules">《会员规则》</text></view>
<!-- <view wx:else><text>我已阅读并同意</text><text class='rule-text' bindtap="handelToMemberRules">《激活领卡规则》</text></view>-->
</view>
</view>
<view class='close' bindtap='close'>
<image class='close-img' src='/assets/imgs/close.png'></image>
</view>
</view>
</view>
\ No newline at end of file
src/component/authorization-modal-point/authorization-modal-point.wxss
0 → 100644
View file @
f6a05cc3
/* component/authorization-modal/authorization-modal.wxss */
.modal {
position: absolute;
right: 0;
left: 0;
bottom: 0;
top: 0;
background-color: transparent;
}
.auto-old {
display: flex;
padding-bottom: 10rpx;
}
.auto-old-num {
display: inline-block;
width: 60rpx;
}
.modal-mask {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.6);
opacity: 1;
z-index: 3;
}
.modal-container {
position: fixed;
left: 96rpx;
/* top: 262rpx; */
/* top: 18%; */
background-color: #fff;
width: 570rpx;
min-height: 450rpx;
z-index: 4;
border-radius: 20rpx;
}
.auth-avatar{
width: 126rpx;
height: 126rpx;
/* margin: 120rpx auto 92rpx; */
margin: 60rpx auto 60rpx;
}
.auth-avatar-img{
width: 126rpx;
height: 126rpx;
}
.auth-shop{
width: 400rpx;
margin: 0 auto;
font-size: 30rpx;
color: #333333;
}
.agree{
width: 416rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
background-color: #05c35b !important;
margin: 50rpx auto 32rpx;
}
.agree-rule{
font-size: 22rpx;
color: #666666;
display: flex;
padding-bottom: 50rpx;
}
.agree-icon{
margin-right: 10rpx;
}
.rule-text{
color: #05c35b;
}
.rule-wrap{
margin-left: 76rpx;
}
.close-img{
width: 58rpx;
height: 58rpx;
position: absolute;
bottom: -120rpx;
left: 265rpx;
}
src/pages/pointDetail/pointDetail.js
View file @
f6a05cc3
...
@@ -36,6 +36,7 @@ wxService.page({
...
@@ -36,6 +36,7 @@ wxService.page({
showGetBtn
:
true
,
// 默认展示 未达成按钮
showGetBtn
:
true
,
// 默认展示 未达成按钮
currentStatus
:
2
,
// 活动状态 1 未生效 2 生效中 3 已失效 0 已删除
currentStatus
:
2
,
// 活动状态 1 未生效 2 生效中 3 已失效 0 已删除
currentTimeStatus
:
1
,
// 1 进行中 2 已结束 3 未开始
currentTimeStatus
:
1
,
// 1 进行中 2 已结束 3 未开始
isAuthorization
:
false
,
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
...
@@ -235,16 +236,46 @@ wxService.page({
...
@@ -235,16 +236,46 @@ wxService.page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
// 登录接口返回err
const
reLoginErrFlag
=
wx
.
getStorageSync
(
'reLoginErr'
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
{
id
}
=
this
.
options
const
{
id
}
=
this
.
options
if
(
id
)
{
if
(
baseUserInfo
&&
!
reLoginErrFlag
){
this
.
setData
({
this
.
setData
({
id
isAuthorization
:
false
},
()
=>
{
},()
=>
{
this
.
getPointDetail
(
id
)
if
(
id
)
{
this
.
setData
({
id
},
()
=>
{
this
.
getPointDetail
(
id
)
})
}
// 隐藏 dialog
this
.
isShowDialog
(
false
)
})
}
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
){
this
.
setData
({
isAuthorization
:
true
})
}
else
{
this
.
setData
({
isAuthorization
:
true
})
})
}
}
// 隐藏 dialog
this
.
isShowDialog
(
false
)
// if (id) {
// this.setData({
// id
// }, () => {
// this.getPointDetail(id)
// })
// }
// // 隐藏 dialog
// this.isShowDialog(false)
},
},
/**
/**
...
...
src/pages/pointDetail/pointDetail.json
View file @
f6a05cc3
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
"status-img"
:
"/component/statusPoint/statusPoint"
,
"status-img"
:
"/component/statusPoint/statusPoint"
,
"x-dialog"
:
"/component/dialog/dialog"
,
"x-dialog"
:
"/component/dialog/dialog"
,
"x-progress-point"
:
"/component/progressPoint/progressPoint"
,
"x-progress-point"
:
"/component/progressPoint/progressPoint"
,
"x-progress-image"
:
"/component/progressImage/progressImage"
"x-progress-image"
:
"/component/progressImage/progressImage"
,
"authorization-modal-point"
:
"/component/authorization-modal-point/authorization-modal-point"
}
}
}
}
\ No newline at end of file
src/pages/pointDetail/pointDetail.wxml
View file @
f6a05cc3
...
@@ -59,3 +59,4 @@
...
@@ -59,3 +59,4 @@
show="{{dialog.show}}"
show="{{dialog.show}}"
/>
/>
<authorization-modal-point isAuthorization='{{isAuthorization}}'/>
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