Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
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
viitto
mallapp
Commits
60799c67
Commit
60799c67
authored
Sep 25, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
25b48f40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
index.vue
pages/index/index.vue
+18
-9
No files found.
pages/index/index.vue
View file @
60799c67
...
@@ -218,10 +218,7 @@ export default {
...
@@ -218,10 +218,7 @@ export default {
if
(
options
&&
options
.
SmallShopId
)
{
if
(
options
&&
options
.
SmallShopId
)
{
uni
.
setStorageSync
(
"SmallShopId"
,
{
SmallShopId
:
options
.
SmallShopId
});
uni
.
setStorageSync
(
"SmallShopId"
,
{
SmallShopId
:
options
.
SmallShopId
});
}
}
if
(
options
&&
options
.
Up
)
{
//校园id
uni
.
setStorageSync
(
"Up"
,
{
Up
:
options
.
Up
});
this
.
IsOpenSchool
=
options
.
Up
==
2
?
1
:
0
}
if
(
options
&&
options
.
scene
)
{
if
(
options
&&
options
.
scene
)
{
//兼容之前小程序的调转
//兼容之前小程序的调转
...
@@ -269,6 +266,13 @@ export default {
...
@@ -269,6 +266,13 @@ export default {
this
.
GoodsId
=
options
.
GoodsId
?
options
.
GoodsId
:
29
;
this
.
GoodsId
=
options
.
GoodsId
?
options
.
GoodsId
:
29
;
}
}
that
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
that
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
that
.
u
){
//进入页面时 判断登录缓存里是否是校园模式
that
.
IsOpenSchool
=
that
.
u
.
UserPageType
==
2
?
1
:
0
}
if
(
options
&&
options
.
Up
)
{
//校园id
uni
.
setStorageSync
(
"Up"
,
{
Up
:
options
.
Up
});
that
.
IsOpenSchool
=
options
.
Up
==
2
?
1
:
0
//分享进来是否是校园模式
}
wx
.
getUserInfo
({
wx
.
getUserInfo
({
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
uni
.
getStorageSync
(
"mall_UserInfo"
))
{
if
(
uni
.
getStorageSync
(
"mall_UserInfo"
))
{
...
@@ -480,7 +484,7 @@ export default {
...
@@ -480,7 +484,7 @@ export default {
uni
.
removeStorageSync
(
"SmallShopId"
);
uni
.
removeStorageSync
(
"SmallShopId"
);
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"Up"
);
that
.
getPageType
()
that
.
getPageType
()
if
(
this
.
IsOpenSchool
!=
res
.
data
.
IsOpenSchool
){
if
(
res
.
data
.
IsOpenSchool
==
1
){
//校园开启
that
.
init
()
that
.
init
()
}
}
// 如果登录的情况下直接跳转商品详情或者直播列表
// 如果登录的情况下直接跳转商品详情或者直播列表
...
@@ -578,15 +582,20 @@ export default {
...
@@ -578,15 +582,20 @@ export default {
return
n
.
substr
(
1
);
return
n
.
substr
(
1
);
},
},
init
()
{
init
()
{
if
(
this
.
IsOpenSchool
==
0
){
let
mall_IsOpenSchool
=
uni
.
getStorageSync
(
"mall_UserInfo"
)?
uni
.
getStorageSync
(
"mall_UserInfo"
).
IsOpenSchool
:
0
this
.
IsOpenSchool
=
uni
.
getStorageSync
(
"mall_UserInfo"
)?
uni
.
getStorageSync
(
"mall_UserInfo"
).
IsOpenSchool
:
0
;
let
open_school
=
0
;
console
.
log
(
this
.
IsOpenSchool
,
mall_IsOpenSchool
)
if
(
this
.
IsOpenSchool
==
1
&&
mall_IsOpenSchool
==
1
){
//this.IsOpenSchool 通过分享进来的 是否是校园 1 是0不是 mall_IsOpenSchool缓存获取校园模式开启没有
open_school
=
1
}
else
{
open_school
=
0
}
}
this
.
request2
(
this
.
request2
(
{
{
url
:
"/api/Mall/GetHome"
,
url
:
"/api/Mall/GetHome"
,
data
:
{
data
:
{
page_id
:
this
.
pageId
,
page_id
:
this
.
pageId
,
open_school
:
this
.
IsOpenS
chool
,
open_school
:
open_s
chool
,
},
},
},
},
(
res
)
=>
{
(
res
)
=>
{
...
@@ -806,7 +815,7 @@ export default {
...
@@ -806,7 +815,7 @@ export default {
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
this
.
$refs
.
son
[
0
].
getSmallShopById
(
2
);
//第一次登陆成功后去调取微店的信息
this
.
$refs
.
son
[
0
].
getSmallShopById
(
2
);
//第一次登陆成功后去调取微店的信息
this
.
getPageType
()
//获取用户类型(校园)
this
.
getPageType
()
//获取用户类型(校园)
if
(
this
.
IsOpenSchool
!=
this
.
u
.
IsOpenSchool
){
if
(
this
.
u
.
IsOpenSchool
==
1
){
this
.
init
()
this
.
init
()
}
}
// 如果登录的情况下直接跳转商品详情或者直播列表
// 如果登录的情况下直接跳转商品详情或者直播列表
...
...
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