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
d8daac12
Commit
d8daac12
authored
Dec 31, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录处理
parent
1449ee1c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
35 deletions
+70
-35
index.vue
components/auth/index.vue
+4
-2
index.vue
pages/index/index.vue
+57
-30
user-center.vue
pages/user-center/user-center.vue
+5
-2
api.js
plugin/api.js
+4
-1
No files found.
components/auth/index.vue
View file @
d8daac12
...
...
@@ -118,7 +118,7 @@
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
0
;
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
''
;
that
.
request2
({
url
:
'/api/AppletLogin/Login'
,
data
:
{
...
...
@@ -130,7 +130,8 @@
SuperiorId
:
pid
,
SmallShopId
:
SmallShopId
,
UserPageType
:
Up
,
CounponPassword
:
CounponPassword
CounponPassword
:
CounponPassword
,
KeyWord
:
KeyWord
,
}
},
res
=>
{
...
...
@@ -146,6 +147,7 @@
uni
.
removeStorageSync
(
'SmallShopId'
);
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"CounponPassword"
);
uni
.
removeStorageSync
(
"KeyWord"
);
}
}
);
...
...
pages/index/index.vue
View file @
d8daac12
...
...
@@ -130,7 +130,7 @@
add_show
:
1
,
showtabs
:
true
,
showCoupons
:
false
,
couponMessage
:
""
,
couponMessage
:
"
恭喜获得20元优惠券
"
,
pageTitleStr
:
""
,
titleStyle
:
""
,
pagePaddingBottom
:
"0px"
,
...
...
@@ -184,6 +184,7 @@
educationteacher
},
onLoad
(
options
)
{
let
that
=
this
;
uni
.
getSystemInfo
({
success
(
res
)
{
...
...
@@ -254,12 +255,27 @@
SmallShopId
:
options
.
SmallShopId
});
}
options
=
{
CounponPassword
:
5
,
KeyWord
:
'sadaskdjas'
,
ComeFrom
:
'甲鹤专属'
,
}
//从其他小程序跳转过来
if
(
options
&&
options
.
CounponPassword
)
{
if
(
options
&&
options
.
CounponPassword
)
{
//小程序的来自
uni
.
setStorageSync
(
"CounponPassword"
,
{
CounponPassword
:
options
.
CounponPassword
});
}
if
(
options
&&
options
.
KeyWord
)
{
//口令
uni
.
setStorageSync
(
"KeyWord"
,
{
KeyWord
:
options
.
KeyWord
});
}
if
(
options
&&
options
.
ComeFrom
)
{
//跳过来的文字描述
uni
.
setStorageSync
(
"ComeFrom"
,
{
ComeFrom
:
options
.
ComeFrom
});
}
if
(
options
&&
options
.
scene
)
{
//兼容之前小程序的调转
this
.
getjump
(
options
.
scene
);
...
...
@@ -326,34 +342,14 @@
};
that
.
updateuserinfo
(
msg
);
that
.
getPageType
()
that
.
sharejump
();
// 如果登录的情况下直接跳转商品详情或者直播列表
that
.
sharejump
();
//如果登录状态 并且是uni.getStorageSync("CounponPassword")
if
(
uni
.
getStorageSync
(
"CounponPassword"
)){
that
.
getunilogin
(
res
)
}
}
else
{
//静默登录操作
uni
.
login
({
provider
:
"weixin"
,
success
:
(
info
)
=>
{
let
obj
=
{
Name
:
res
.
userInfo
.
nickName
,
Photo
:
res
.
userInfo
.
avatarUrl
,
code
:
info
.
code
,
};
that
.
getCode
(
obj
);
},
fail
:
()
=>
{
uni
.
showToast
({
title
:
"微信登录授权失败"
,
icon
:
"none"
});
if
(
!
that
.
u
)
{
that
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
,
};
that
.
showAuth
=
true
;
}
},
});
that
.
getunilogin
(
res
)
}
},
fail
:
function
(
e
)
{
...
...
@@ -487,6 +483,34 @@
},
methods
:
{
getunilogin
(
res
){
let
that
=
this
//静默登录操作
uni
.
login
({
provider
:
"weixin"
,
success
:
(
info
)
=>
{
let
obj
=
{
Name
:
res
.
userInfo
.
nickName
,
Photo
:
res
.
userInfo
.
avatarUrl
,
code
:
info
.
code
,
};
that
.
getCode
(
obj
);
},
fail
:
()
=>
{
uni
.
showToast
({
title
:
"微信登录授权失败"
,
icon
:
"none"
});
if
(
!
that
.
u
)
{
that
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
,
};
that
.
showAuth
=
true
;
}
},
});
},
//获取IsOpenReserve
getIsOpenReserve
(){
this
.
request2
({
...
...
@@ -589,6 +613,7 @@
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
0
;
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
''
;
that
.
request2
({
url
:
"/api/AppletLogin/Login"
,
...
...
@@ -601,7 +626,8 @@
SuperiorId
:
pid
,
SmallShopId
:
SmallShopId
,
UserPageType
:
Up
,
CounponPassword
:
CounponPassword
CounponPassword
:
CounponPassword
,
KeyWord
:
KeyWord
,
},
},
(
res
)
=>
{
...
...
@@ -616,6 +642,7 @@
uni
.
removeStorageSync
(
"SmallShopId"
);
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"CounponPassword"
);
uni
.
removeStorageSync
(
"KeyWord"
);
that
.
getPageType
()
if
(
res
.
data
.
IsOpenSchool
==
1
)
{
//校园开启
that
.
init
()
...
...
@@ -1094,7 +1121,7 @@
},
yj
(){
uni
.
navigateTo
({
url
:
'/pages/school/investigation?ID=
9
'
//6未开始 9已填 10 //活动结束 //4未填写
url
:
'/pages/school/investigation?ID=
4
'
//6未开始 9已填 10 //活动结束 //4未填写
})
}
},
...
...
pages/user-center/user-center.vue
View file @
d8daac12
...
...
@@ -310,7 +310,7 @@
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
0
;
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
''
;
that
.
request2
({
url
:
'/api/AppletLogin/Login'
,
data
:
{
...
...
@@ -322,7 +322,8 @@
SuperiorId
:
pid
,
SmallShopId
:
SmallShopId
,
UserPageType
:
Up
,
CounponPassword
:
CounponPassword
CounponPassword
:
CounponPassword
,
KeyWord
:
KeyWord
,
}
},
res
=>
{
...
...
@@ -331,6 +332,8 @@
uni
.
removeStorageSync
(
'pid'
);
uni
.
removeStorageSync
(
'SmallShopId'
);
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"CounponPassword"
);
uni
.
removeStorageSync
(
"KeyWord"
);
}
}
);
...
...
plugin/api.js
View file @
d8daac12
...
...
@@ -81,6 +81,7 @@ export default {
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
0
;
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
''
;
this
.
request2
({
url
:
'/api/AppletLogin/Login'
,
data
:
{
...
...
@@ -92,7 +93,8 @@ export default {
SuperiorId
:
pid
,
SmallShopId
:
SmallShopId
,
UserPageType
:
Up
,
CounponPassword
:
CounponPassword
CounponPassword
:
CounponPassword
,
KeyWord
:
KeyWord
,
}
},
res
=>
{
...
...
@@ -102,6 +104,7 @@ export default {
uni
.
removeStorageSync
(
'SmallShopId'
);
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"CounponPassword"
);
uni
.
removeStorageSync
(
"KeyWord"
);
}
}
);
...
...
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