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
53fa7b91
Commit
53fa7b91
authored
Sep 10, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
watch
parent
e8c704c0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
8 deletions
+16
-8
app.js
src/app.js
+1
-1
pointDetail.js
src/pages/pointDetail/pointDetail.js
+5
-1
pointList.js
src/pages/pointList/pointList.js
+7
-1
watch.js
src/utils/watch.js
+0
-4
wxService.js
src/utils/wxService.js
+3
-1
No files found.
src/app.js
View file @
53fa7b91
...
@@ -41,7 +41,7 @@ App({
...
@@ -41,7 +41,7 @@ App({
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前会员是否是体验者
// 获取当前会员是否是体验者
const
{
member
}
=
baseUserInfo
const
{
member
}
=
baseUserInfo
const
curMemberTrial
=
member
.
trial
||
false
const
curMemberTrial
=
member
&&
member
.
trial
||
false
wx
.
setStorageSync
(
'isExperiencer'
,
curMemberTrial
)
wx
.
setStorageSync
(
'isExperiencer'
,
curMemberTrial
)
if
(
options
.
referrerInfo
.
extraData
!=
null
){
if
(
options
.
referrerInfo
.
extraData
!=
null
){
...
...
src/pages/pointDetail/pointDetail.js
View file @
53fa7b91
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
const
app
=
getApp
()
const
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
const
utils
=
require
(
'../../utils/util'
)
// import * as watch from "../../utils/watch.js";
wxService
.
page
({
wxService
.
page
({
/**
/**
...
@@ -41,9 +42,12 @@ wxService.page({
...
@@ -41,9 +42,12 @@ wxService.page({
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
()
{},
onLoad
()
{
// watch.setWatcher(this);
},
watch
:
{
watch
:
{
experAccessible
(
newVal
,
oldVal
)
{
experAccessible
(
newVal
,
oldVal
)
{
console
.
log
(
'集点详情'
,
newVal
)
if
(
newVal
)
{
if
(
newVal
)
{
// 登录接口返回err
// 登录接口返回err
const
reLoginErrFlag
=
wx
.
getStorageSync
(
'reLoginErr'
)
const
reLoginErrFlag
=
wx
.
getStorageSync
(
'reLoginErr'
)
...
...
src/pages/pointList/pointList.js
View file @
53fa7b91
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
const
app
=
getApp
()
const
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
const
utils
=
require
(
'../../utils/util'
)
// import * as watch from "../../utils/watch.js";
wxService
.
page
({
wxService
.
page
({
/**
/**
...
@@ -16,9 +17,12 @@ wxService.page({
...
@@ -16,9 +17,12 @@ wxService.page({
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
()
{},
onLoad
()
{
// watch.setWatcher(this);
},
watch
:
{
watch
:
{
experAccessible
(
newVal
,
oldVal
)
{
experAccessible
(
newVal
,
oldVal
)
{
console
.
log
(
'集点列表'
,
newVal
)
if
(
newVal
)
{
if
(
newVal
)
{
this
.
getPointList
()
this
.
getPointList
()
}
else
{
}
else
{
...
@@ -36,6 +40,8 @@ wxService.page({
...
@@ -36,6 +40,8 @@ wxService.page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{
const
{
experAccessible
}
=
this
.
data
console
.
log
(
'experAccessible'
,
experAccessible
)
// wxService.nextTick(() => {
// wxService.nextTick(() => {
// const { experAccessible } = this.data
// const { experAccessible } = this.data
// console.log('experAccessible', experAccessible)
// console.log('experAccessible', experAccessible)
...
...
src/utils/watch.js
View file @
53fa7b91
...
@@ -31,15 +31,11 @@ export function setWatcher(page) {
...
@@ -31,15 +31,11 @@ export function setWatcher(page) {
Object
.
keys
(
watch
).
forEach
((
item
)
=>
{
Object
.
keys
(
watch
).
forEach
((
item
)
=>
{
let
targetData
=
data
;
let
targetData
=
data
;
let
keys
=
item
.
split
(
"."
);
let
keys
=
item
.
split
(
"."
);
for
(
let
i
=
0
;
i
<
keys
.
length
-
1
;
i
++
)
{
for
(
let
i
=
0
;
i
<
keys
.
length
-
1
;
i
++
)
{
targetData
=
targetData
[
keys
[
i
]];
targetData
=
targetData
[
keys
[
i
]];
}
}
let
targetKey
=
keys
[
keys
.
length
-
1
];
let
targetKey
=
keys
[
keys
.
length
-
1
];
let
watchFun
=
watch
[
item
].
handler
||
watch
[
item
];
let
watchFun
=
watch
[
item
].
handler
||
watch
[
item
];
let
deep
=
watch
[
item
].
deep
;
let
deep
=
watch
[
item
].
deep
;
observe
(
targetData
,
targetKey
,
watchFun
,
deep
,
page
);
observe
(
targetData
,
targetKey
,
watchFun
,
deep
,
page
);
});
});
...
...
src/utils/wxService.js
View file @
53fa7b91
...
@@ -431,10 +431,12 @@ class WXService extends Http {
...
@@ -431,10 +431,12 @@ class WXService extends Http {
_self
.
trialList
().
then
(
res
=>
{
_self
.
trialList
().
then
(
res
=>
{
if
(
!
res
)
return
false
if
(
!
res
)
return
false
const
{
currentPaths
}
=
res
const
{
currentPaths
}
=
res
console
.
log
(
'22222'
,
currentPaths
,
currentPaths
.
indexOf
(
router
.
route
),
isExperiencer
)
if
(
currentPaths
.
indexOf
(
router
.
route
)
>
-
1
&&
isExperiencer
)
{
if
(
currentPaths
.
indexOf
(
router
.
route
)
>
-
1
&&
isExperiencer
)
{
this
.
setData
({
this
.
setData
({
experAccessible
:
true
experAccessible
:
true
},()
=>
{
console
.
log
(
'experAccessible'
,
this
.
data
.
experAccessible
)
})
})
}
}
})
})
...
...
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