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
73c4b1de
Commit
73c4b1de
authored
Jun 18, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 新激活会员卡弹框
parent
09dad438
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
21 deletions
+62
-21
authorization-modal.js
src/component/authorization-modal/authorization-modal.js
+20
-4
authorization-modal.wxml
src/component/authorization-modal/authorization-modal.wxml
+4
-4
picNav.js
src/component/picNav/picNav.js
+34
-9
picNav.wxml
src/component/picNav/picNav.wxml
+2
-2
wxService.js
src/utils/wxService.js
+2
-2
No files found.
src/component/authorization-modal/authorization-modal.js
View file @
73c4b1de
...
@@ -8,7 +8,15 @@ Component({
...
@@ -8,7 +8,15 @@ Component({
* 组件的属性列表
* 组件的属性列表
*/
*/
properties
:
{
properties
:
{
isAuthorization
:
Boolean
isAuthorization
:
Boolean
,
isAuthorizationActiveText
:
{
type
:
String
,
value
:
''
},
isAuthorizationType
:
{
type
:
Number
,
value
:
2
},
},
},
/**
/**
...
@@ -19,9 +27,8 @@ Component({
...
@@ -19,9 +27,8 @@ Component({
userInfo
:
{},
userInfo
:
{},
hasUserInfo
:
false
,
hasUserInfo
:
false
,
env
:
envInfo
.
env
,
env
:
envInfo
.
env
,
checkAll
:
true
,
checkAll
:
true
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
*/
*/
...
@@ -32,7 +39,7 @@ Component({
...
@@ -32,7 +39,7 @@ Component({
})
})
},
},
handelToMemberRules
()
{
handelToMemberRules
()
{
wxService
.
router
(
'/pages/memberRules/memberRules?type=2'
)
wxService
.
router
(
`/pages/memberRules/memberRules?type=
${
this
.
data
.
isAuthorizationType
}
`
)
},
},
//再想想
//再想想
close
()
{
close
()
{
...
@@ -75,6 +82,15 @@ Component({
...
@@ -75,6 +82,15 @@ Component({
})
})
}
}
},
},
handleActiveAgree
()
{
// 子组件触发父组件 去开卡
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'activeTocard'
,
true
)
})
this
.
setData
({
isAuthorization
:
false
})
},
setUserInfo
()
{
setUserInfo
()
{
// 判断有无开卡
// 判断有无开卡
// const memberActivateStatus = wx.getStorageSync('memberActivateStatus')
// const memberActivateStatus = wx.getStorageSync('memberActivateStatus')
...
...
src/component/authorization-modal/authorization-modal.wxml
View file @
73c4b1de
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
<view class='auth-avatar'>
<view class='auth-avatar'>
<image class='auth-avatar-img' src='/assets/imgs/auth-avatar.png'></image>
<image class='auth-avatar-img' src='/assets/imgs/auth-avatar.png'></image>
</view>
</view>
<view class='auth-shop'>
<view class='auth-shop'
wx:if="{{isAuthorizationActiveText}}">{{isAuthorizationActiveText}}</view
>
广东7-Eleven申请获取授权,用于会员服务
<view class='auth-shop' wx:else>广东7-Eleven申请获取授权,用于会员服务</view>
<
/view
>
<
button type='primary' wx:if="{{!isAuthorizationActiveText}}" bindgetuserinfo="_getUserInfo" open-type='getUserInfo' class='agree' disabled='{{!checkAll}}'>同意</button
>
<button type='primary'
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='rule-wrap'>
<view class='agree-rule'>
<view class='agree-rule'>
<view class="agree-icon"><icon size="18" type="{{checkAll ? 'success' : 'circle'}}" bindtap="checkAll"></icon></view>
<view class="agree-icon"><icon size="18" type="{{checkAll ? 'success' : 'circle'}}" bindtap="checkAll"></icon></view>
...
...
src/component/picNav/picNav.js
View file @
73c4b1de
...
@@ -22,7 +22,9 @@ Component({
...
@@ -22,7 +22,9 @@ Component({
data
:
{
data
:
{
imagewidth
:
0
,
//缩放后的宽
imagewidth
:
0
,
//缩放后的宽
imageheight
:
0
,
//缩放后的高
imageheight
:
0
,
//缩放后的高
isAuthorization
:
false
isAuthorization
:
false
,
isAuthorizationActiveText
:
''
,
isAuthorizationType
:
2
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
...
@@ -42,7 +44,7 @@ Component({
...
@@ -42,7 +44,7 @@ Component({
const
accountInfo
=
utils
.
getAccountInfo
()
const
accountInfo
=
utils
.
getAccountInfo
()
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 2019.06.14
// 2019.06.14
let
currentClickType
=
app
.
globalData
.
commonFunc
.
getLink
(
item
.
link
.
type
,
item
)
let
currentClickType
=
app
.
globalData
.
commonFunc
.
getLink
(
item
.
link
.
type
,
item
)
if
(
link
.
type
==
1
)
{
if
(
link
.
type
==
1
)
{
// 触发父组件更新页面 外部小程序
// 触发父组件更新页面 外部小程序
...
@@ -51,13 +53,21 @@ Component({
...
@@ -51,13 +53,21 @@ Component({
})
})
return
false
return
false
}
else
if
(
!
userInfo
)
{
}
else
if
(
!
userInfo
)
{
// userInfo 不存在 授权弹框
this
.
setData
({
this
.
setData
({
isAuthorization
:
true
isAuthorization
:
true
})
})
return
false
return
false
}
else
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
wxService
.
openCard
()
}
else
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
return
false
// userInfo 存在 手机号不存在 跳转激活领卡页面
this
.
setData
({
isAuthorizationActiveText
:
'新激活领卡'
,
isAuthorization
:
true
},()
=>
{
wxService
.
openCard
()
return
false
})
}
}
if
(
link
.
type
==
2
)
{
if
(
link
.
type
==
2
)
{
...
@@ -74,12 +84,27 @@ Component({
...
@@ -74,12 +84,27 @@ Component({
}
else
if
(
link
.
type
==
4
)
{
}
else
if
(
link
.
type
==
4
)
{
wxService
.
router
(
`
${
currentClickType
}
`
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
else
if
(
link
.
type
==
5
)
{
}
else
if
(
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
// wxService.openCardList()
this
.
setData
({
wxService
.
openCard
()
isAuthorizationActiveText
:
'新激活领卡'
,
}
else
if
(
currentClickType
==
2
)
{
isAuthorizationType
:
3
,
isAuthorization
:
true
})
}
else
{
wxService
.
openCard
()
wxService
.
openCard
()
}
}
// if (currentClickType == 1) {
// // wxService.openCardList()
// wxService.openCard()
// } else if (currentClickType == 2) {
// wxService.openCard()
// }
}
},
activeTocard
(
e
){
if
(
e
.
detail
){
wxService
.
openCard
()
}
}
}
}
}
}
...
...
src/component/picNav/picNav.wxml
View file @
73c4b1de
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
-->
-->
<view class="pic-nav"><view wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item" class="nav-block" style="width: {{imagewidth}}px;height: {{imageheight}}px;"><image class="pic-img" style="width: {{imagewidth}}px;height: {{imageheight}}px;" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" data-link="{{item.link}}" data-item="{{item}}" bindload="imageLoad" bindtap='preview'/></view></view>
<view class="pic-nav"><view wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item" class="nav-block" style="width: {{imagewidth}}px;height: {{imageheight}}px;"><image class="pic-img" style="width: {{imagewidth}}px;height: {{imageheight}}px;" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" data-link="{{item.link}}" data-item="{{item}}" bindload="imageLoad" bindtap='preview'/></view></view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<authorization-modal isAuthorization='{{isAuthorization}}' bind:activeTocard="activeTocard" isAuthorizationType="{{isAuthorizationType}}" isAuthorizationActiveText="{{isAuthorizationActiveText}}"/>
\ No newline at end of file
\ No newline at end of file
src/utils/wxService.js
View file @
73c4b1de
...
@@ -47,7 +47,7 @@ class WXService extends Http {
...
@@ -47,7 +47,7 @@ class WXService extends Http {
this
.
setPageLoadStatus
()
this
.
setPageLoadStatus
()
wx
.
hideLoading
()
wx
.
hideLoading
()
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
if
(
res
.
msg
.
indexOf
(
'未登录'
)
>
-
1
)
{
if
(
res
.
msg
&&
res
.
msg
.
indexOf
(
'未登录'
)
>
-
1
)
{
// 重新登陆 更新缓存
// 重新登陆 更新缓存
this
.
reLogin
()
this
.
reLogin
()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -525,7 +525,7 @@ class WXService extends Http {
...
@@ -525,7 +525,7 @@ class WXService extends Http {
reject
({
state
:
0
})
reject
({
state
:
0
})
}
}
})
})
// 注释原因 所有跳转前 判断新老会员
// return new Promise((resolve, reject) => {
// return new Promise((resolve, reject) => {
// if (baseUserInfo && baseUserInfo.member && baseUserInfo.member.mobile) {
// if (baseUserInfo && baseUserInfo.member && baseUserInfo.member.mobile) {
// console.log('已开卡')
// console.log('已开卡')
...
...
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