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
68217022
Commit
68217022
authored
Jun 04, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 首页跳转路径
parent
afe1774e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
4 deletions
+51
-4
picNav.js
src/component/picNav/picNav.js
+25
-0
picNav.wxml
src/component/picNav/picNav.wxml
+1
-1
userCenter.js
src/pages/userCenter/userCenter.js
+24
-2
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+1
-1
No files found.
src/component/picNav/picNav.js
View file @
68217022
...
...
@@ -2,6 +2,7 @@
// component/picNav/picNav.js
var
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
const
envInfo
=
require
(
'../../config/index'
).
envInfo
Component
({
...
...
@@ -25,6 +26,30 @@ Component({
* 组件的方法列表
*/
methods
:
{
preview
(
e
)
{
const
{
appid
,
path
}
=
e
.
currentTarget
.
dataset
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
// 是当前小程序 直接跳转
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
wxService
.
router
(
`
${
path
}
`
)
}
else
{
// 跳转其他小程序
wx
.
navigateToMiniProgram
({
appId
:
appid
,
path
:
`
${
path
}
`
,
success
:
e
=>
{
console
.
log
(
e
)
},
fail
:
e
=>
{
console
.
log
(
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
}
}
}
})
src/component/picNav/picNav.wxml
View file @
68217022
<!--component/picNav/picNav.wxml-->
<view class="pic-nav">
<block wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item" class="pic-content">
<view class="pic-item"><image class="pic-img" src="http://testimg3.bigaka.com{{item.imageUrl}}" mode="scaleToFill"/></view>
<view class="pic-item"><image class="pic-img" src="http://testimg3.bigaka.com{{item.imageUrl}}"
data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindtap='preview'
mode="scaleToFill"/></view>
</block>
</view>
src/pages/userCenter/userCenter.js
View file @
68217022
...
...
@@ -68,8 +68,30 @@ wxService.page({
// endX, endY, startX, startY
const
{
startX
,
startY
}
=
this
.
data
let
isTouchLeft
=
utils
.
getTouchData
(
x
,
y
,
startX
,
startY
)
if
(
isTouchLeft
==
left
)
{
// 触发左划事件
if
(
isTouchLeft
==
'left'
)
{
const
{
appid
,
path
}
=
e
.
currentTarget
.
dataset
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
// 是当前小程序 直接跳转
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
wxService
.
router
(
`
${
path
}
`
)
}
else
{
// 跳转其他小程序
wx
.
navigateToMiniProgram
({
appId
:
appid
,
path
:
`
${
path
}
`
,
success
:
e
=>
{
console
.
log
(
e
)
},
fail
:
e
=>
{
console
.
log
(
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
}
}
},
// page 信息
...
...
src/pages/userCenter/userCenter.wxml
View file @
68217022
...
...
@@ -21,7 +21,7 @@
</view>
<!-- 底部 -->
<view class="images-tab" wx:if="{{pItem.type == 4}}">
<view class='footer-content' style="background:{{pItem.bottom.color}};color:{{pItem.bottom.color}}" catchtouchstart='touchStart' catchtouchend="touchEnd">
<view class='footer-content' style="background:{{pItem.bottom.color}};color:{{pItem.bottom.color}}"
data-appid="{{pItem.bottom.link.appid}}" data-path="{{pItem.bottom.link.url}}"
catchtouchstart='touchStart' catchtouchend="touchEnd">
<text class="footer-arrow" style="color:{{pItem.bottom.fontColor}}"><<</text>
<text class='footer-text' style="color:{{pItem.bottom.fontColor}}">{{pItem.bottom.title}}</text>
</view>
...
...
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