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
024edd4b
Commit
024edd4b
authored
Jun 15, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 弹框判断
parent
1d000e8c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
83 deletions
+67
-83
bottom.js
src/component/bottom/bottom.js
+21
-21
imageSwiper.js
src/component/imageSwiper/imageSwiper.js
+18
-15
picNav.js
src/component/picNav/picNav.js
+21
-45
common.js
src/utils/common.js
+7
-2
No files found.
src/component/bottom/bottom.js
View file @
024edd4b
...
@@ -16,7 +16,7 @@ Component({
...
@@ -16,7 +16,7 @@ Component({
value
:
{},
value
:
{},
},
},
},
},
attached
()
{
},
attached
()
{
},
/**
/**
* 组件的初始数据
* 组件的初始数据
*/
*/
...
@@ -39,48 +39,48 @@ Component({
...
@@ -39,48 +39,48 @@ Component({
let
x
=
e
.
changedTouches
[
0
].
clientX
;
let
x
=
e
.
changedTouches
[
0
].
clientX
;
let
y
=
e
.
changedTouches
[
0
].
clientY
;
let
y
=
e
.
changedTouches
[
0
].
clientY
;
// endX, endY, startX, startY
// endX, endY, startX, startY
const
{
startX
,
startY
}
=
this
.
data
const
{
startX
,
startY
}
=
this
.
data
let
isTouchLeft
=
utils
.
getTouchData
(
x
,
y
,
startX
,
startY
)
let
isTouchLeft
=
utils
.
getTouchData
(
x
,
y
,
startX
,
startY
)
// 触发左划事件
// 触发左划事件
if
(
isTouchLeft
==
'left'
)
{
if
(
isTouchLeft
==
'left'
)
{
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
// 是当前小程序 直接跳转
if
(
wx
.
getStorageSync
(
'_baseUserInfo'
)){
// navigateToMiniProgram:fail can only be invoked by user TAP gesture.
// navigateToMiniProgram:fail can only be invoked by user TAP gesture.
if
(
link
.
type
==
1
)
return
false
// 更改数据问题
// 更改数据问题
let
currentClickType
=
app
.
globalData
.
commonFunc
.
getLink
(
item
.
link
.
type
,
item
)
let
currentClickType
=
app
.
globalData
.
commonFunc
.
getLink
(
item
.
link
.
type
,
item
)
// type==1 外部 不用弹 没有登录弹
if
(
link
.
type
==
1
)
{
if
(
link
.
type
==
1
)
{
// 触发父组件更新页面 外部小程序
// 触发父组件更新页面 外部小程序
this
.
setData
({
this
.
setData
({
isAuthorization
:
false
isAuthorization
:
false
})
})
return
false
return
false
}
else
if
(
link
.
type
==
2
)
{
}
else
if
(
!
userInfo
)
{
this
.
setData
({
isAuthorization
:
true
})
return
false
}
if
(
link
.
type
==
2
)
{
// 触发父组件更新页面
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
})
})
}
else
if
(
link
.
type
==
3
)
{
}
else
if
(
link
.
type
==
3
)
{
// 预览
// 预览
wx
.
previewImage
({
wx
.
previewImage
({
current
:
`https://images.unsplash.com/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
current
:
`https://images.unsplash.com/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
urls
:
[
`http://testimg3.bigaka.com/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
urls
:
[
`http://testimg3.bigaka.com/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
})
})
}
else
if
(
link
.
type
==
4
)
{
}
else
if
(
link
.
type
==
4
)
{
wxService
.
router
(
`
${
currentClickType
}
`
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
else
if
(
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
wxService
.
openCardList
()
}
else
if
(
currentClickType
==
2
)
{
wxService
.
openCard
()
}
}
}
}
// else{
// this.setData({
// isAuthorization: true
// })
// return false
// }
}
}
}
}
}
}
...
...
src/component/imageSwiper/imageSwiper.js
View file @
024edd4b
...
@@ -15,7 +15,7 @@ Component({
...
@@ -15,7 +15,7 @@ Component({
value
:
[],
value
:
[],
},
},
},
},
attached
()
{
},
attached
()
{
},
/**
/**
* 组件的初始数据
* 组件的初始数据
*/
*/
...
@@ -33,40 +33,43 @@ Component({
...
@@ -33,40 +33,43 @@ Component({
*/
*/
methods
:
{
methods
:
{
preview
(
e
)
{
preview
(
e
)
{
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
// 获取当前帐号信息
// 获取当前帐号信息
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
userInfo
){
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
)
{
// 触发父组件更新页面 外部小程序
// 触发父组件更新页面 外部小程序
this
.
setData
({
this
.
setData
({
isAuthorization
:
false
isAuthorization
:
false
})
})
return
false
return
false
}
else
if
(
link
.
type
==
2
)
{
}
else
if
(
!
userInfo
)
{
this
.
setData
({
isAuthorization
:
true
})
return
false
}
if
(
link
.
type
==
2
)
{
// 触发父组件更新页面
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
})
})
}
else
if
(
link
.
type
==
3
)
{
}
else
if
(
link
.
type
==
3
)
{
// 预览
// 预览
wx
.
previewImage
({
wx
.
previewImage
({
current
:
`https://images.unsplash.com/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
current
:
`https://images.unsplash.com/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
urls
:
[
`http://testimg3.bigaka.com/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
urls
:
[
`http://testimg3.bigaka.com/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
})
})
}
else
if
(
link
.
type
==
4
)
{
}
else
if
(
link
.
type
==
4
)
{
wxService
.
router
(
`
${
currentClickType
}
`
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
else
if
(
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
wxService
.
openCardList
()
}
else
if
(
currentClickType
==
2
)
{
wxService
.
openCard
()
}
}
}
}
// else {
// this.setData({
// isAuthorization: true
// })
// return false
// }
}
}
}
}
})
})
src/component/picNav/picNav.js
View file @
024edd4b
...
@@ -15,7 +15,7 @@ Component({
...
@@ -15,7 +15,7 @@ Component({
value
:
[],
value
:
[],
},
},
},
},
attached
()
{
},
attached
()
{
},
/**
/**
* 组件的初始数据
* 组件的初始数据
*/
*/
...
@@ -36,70 +36,46 @@ Component({
...
@@ -36,70 +36,46 @@ Component({
})
})
},
},
preview
(
e
)
{
preview
(
e
)
{
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
const
{
memberActivateStatus
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
{
memberActivateStatus
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前帐号信息
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
const
accountInfo
=
utils
.
getAccountInfo
()
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
if
(
userInfo
){
// if (!memberActivateStatus){
// wxService.openCard()
// }else{
// wxService.router(`${path}`)
// }
}
else
{
// if (path == '/pages/deliveryService/deliveryService') {
// wxService.router(`${path}`)
// return
// }
// this.setData({
// isAuthorization: true
// })
}
}
else
{
// 跳转其他小程序
// wx.navigateToMiniProgram({
// appId: appid,
// path: `${path}`,
// success: e => {
// console.log(e)
// },
// fail: e => {
// console.log(e)
// },
// complete: e => {
// console.log(e)
// },
// })
}
// if (!userInfo){
// this.setData({
// isAuthorization: true
// })
// return false
// }
// 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
)
{
// 触发父组件更新页面 外部小程序
// 触发父组件更新页面 外部小程序
this
.
setData
({
this
.
setData
({
isAuthorization
:
false
isAuthorization
:
false
})
})
return
false
return
false
}
else
if
(
link
.
type
==
2
)
{
}
else
if
(
!
userInfo
)
{
this
.
setData
({
isAuthorization
:
true
})
return
false
}
if
(
link
.
type
==
2
)
{
// 触发父组件更新页面
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
})
})
}
else
if
(
link
.
type
==
3
)
{
}
else
if
(
link
.
type
==
3
)
{
// 预览
// 预览
wx
.
previewImage
({
wx
.
previewImage
({
current
:
`https://images.unsplash.com/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
current
:
`https://images.unsplash.com/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
urls
:
[
`http://testimg3.bigaka.com/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
urls
:
[
`http://testimg3.bigaka.com/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
})
})
}
else
if
(
link
.
type
==
4
)
{
}
else
if
(
link
.
type
==
4
)
{
wxService
.
router
(
`
${
currentClickType
}
`
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
else
if
(
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
wxService
.
openCardList
()
}
else
if
(
currentClickType
==
2
)
{
wxService
.
openCard
()
}
}
}
}
}
}
}
...
...
src/utils/common.js
View file @
024edd4b
...
@@ -53,12 +53,17 @@ HandlerLink.prototype = {
...
@@ -53,12 +53,17 @@ HandlerLink.prototype = {
}
else
if
(
type
==
4
)
{
}
else
if
(
type
==
4
)
{
return
`
${
item
.
link
.
url
}
`
return
`
${
item
.
link
.
url
}
`
}
else
if
(
type
==
5
)
{
}
else
if
(
type
==
5
)
{
let
currentOpen
=
''
if
(
item
.
link
.
url
==
1
){
if
(
item
.
link
.
url
==
1
){
// 卡包
// 卡包
wxService
.
openCardList
()
currentOpen
=
1
return
currentOpen
// wxService.openCardList()
}
else
if
(
item
.
link
.
url
==
2
){
}
else
if
(
item
.
link
.
url
==
2
){
// 激活领卡--开卡
// 激活领卡--开卡
wxService
.
openCard
()
currentOpen
=
2
return
currentOpen
// wxService.openCard()
}
}
}
}
}
}
...
...
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