Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
points-mall
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a9333c14
authored
Aug 20, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
aafbf6fe
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
20 deletions
api/request/http.js
pages/Login/Login.js
pages/loading/loading.js
pages/tab/cart/index.js
pages/tab/index/index.scss
project.private.config.json
api/request/http.js
View file @
a9333c1
...
@@ -78,20 +78,28 @@ class Request {
...
@@ -78,20 +78,28 @@ class Request {
},
},
data
data
}
=
response
}
=
response
if
(
returnAll
)
{
resolve
(
data
)
return
}
if
(
code
==
20
||
code
==
21
)
{
if
(
code
==
20
||
code
==
21
)
{
wx
.
p
.
storage
.
rm
(
'userInfo'
)
wx
.
p
.
storage
.
rm
(
'sessionId'
)
wx
.
p
.
storage
.
rm
(
'channelSource'
)
wx
.
hideLoading
()
wx
.
hideLoading
()
// session过期跳转到登录页
const
thisPage
=
wx
.
p
.
router
.
getPageInstance
(),
wx
.
p
.
router
.
reLaunch
(
'/pages/Login/Login'
)
options
=
Object
.
keys
(
thisPage
.
options
)
let
currentRoute
=
thisPage
.
route
,
query
=
[]
if
(
options
.
length
)
{
options
.
map
(
key
=>
{
query
.
push
(
`
${
key
}
=
${
thisPage
.
options
[
key
]}
`
)
})
}
if
(
query
.
length
)
currentRoute
+=
`?
${
query
.
join
(
'&'
)}
`
return
wx
.
p
.
router
.
redirectTo
(
'/pages/loading/loading'
,
{
url
:
`/
${
currentRoute
}
`
})
}
else
{
}
else
{
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
if
(
returnAll
)
{
resolve
(
data
)
}
else
{
resolve
(
data
.
data
)
resolve
(
data
.
data
)
}
}
else
{
}
else
{
wx
.
showToast
({
wx
.
showToast
({
title
:
message
||
'系统异常'
,
title
:
message
||
'系统异常'
,
...
...
pages/Login/Login.js
View file @
a9333c1
...
@@ -299,8 +299,10 @@ Page({
...
@@ -299,8 +299,10 @@ Page({
commonApi
.
openPointsWallet
(
walletObj
).
then
(
res
=>
{
commonApi
.
openPointsWallet
(
walletObj
).
then
(
res
=>
{
let
{
code
,
message
}
=
res
let
{
code
,
message
}
=
res
if
(
code
==
0
)
{
if
(
code
==
0
)
{
// 替换钱包昵称
this
.
setData
({
this
.
replaceNickName
({...
walletObj
})
showEnableSuccess
:
true
,
walletObj
})
}
else
{
}
else
{
wx
.
p
.
wxApi
.
showToast
(
message
)
wx
.
p
.
wxApi
.
showToast
(
message
)
}
}
...
@@ -309,7 +311,9 @@ Page({
...
@@ -309,7 +311,9 @@ Page({
// 开通成功
// 开通成功
successConfirm
()
{
successConfirm
()
{
let
{
walletObj
}
=
this
.
data
// 替换钱包昵称
this
.
replaceNickName
({...
walletObj
})
},
},
back
()
{
back
()
{
...
...
pages/loading/loading.js
View file @
a9333c1
...
@@ -25,16 +25,32 @@ Page({
...
@@ -25,16 +25,32 @@ Page({
this
.
login
();
this
.
login
();
},
},
async
login
(
options
=
{})
{
async
login
(
options
=
{})
{
if
(
options
.
merchantId
)
wx
.
$merchant_id
=
options
.
merchantId
;
try
{
try
{
const
{
code
,
data
,
message
}
=
await
commonApi
.
getLoginInfo
();
const
{
code
,
data
,
message
}
=
await
wx
.
p
.
api
.
userApi
.
login
();
if
(
data
)
wx
.
p
.
storage
.
set
(
"merchant_info"
,
{
merchantId
:
data
.
merchantId
,
merchantName
:
data
.
merchantName
,
});
if
(
code
==
"0"
)
{
if
(
code
==
"0"
)
{
wx
.
p
.
isLogin
=
true
;
wx
.
p
.
isLogin
=
true
;
wx
.
p
.
storage
.
set
(
"userInfo"
,
data
)
wx
.
p
.
storage
.
set
(
"sessionId"
,
data
.
sessionId
);
if
(
!
data
)
throw
message
// 获取登录信息
commonApi
.
getLoginInfo
().
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
}
else
{
wx
.
p
.
isLogin
=
false
;
wx
.
p
.
storage
.
rm
(
"userInfo"
);
wx
.
p
.
storage
.
rm
(
"sessionId"
);
}
})
if
(
!
data
)
throw
message
;
}
else
{
}
else
{
wx
.
p
.
isLogin
=
false
;
wx
.
p
.
isLogin
=
false
;
wx
.
p
.
storage
.
rm
(
"userInfo"
);
wx
.
p
.
storage
.
rm
(
"userInfo"
);
wx
.
p
.
storage
.
rm
(
"
channelSource"
)
wx
.
p
.
storage
.
rm
(
"
sessionId"
);
}
}
console
.
log
(
"登陆信息:"
,
data
);
console
.
log
(
"登陆信息:"
,
data
);
if
(
options
.
url
)
{
if
(
options
.
url
)
{
...
...
pages/tab/cart/index.js
View file @
a9333c1
...
@@ -200,8 +200,7 @@ Page({
...
@@ -200,8 +200,7 @@ Page({
let
para
=
{
let
para
=
{
cartType
:
1
cartType
:
1
}
}
wx
.
p
.
api
.
shopmallApi
cartApi
.
getCartList
(
para
)
.
getShoppingcartList
(
para
)
.
then
(
data
=>
{
.
then
(
data
=>
{
data
.
map
(
e
=>
{
data
.
map
(
e
=>
{
e
.
list
.
map
(
i
=>
(
i
.
retailPrice
=
Number
(
i
.
retailPrice
).
toFixed
(
2
)))
e
.
list
.
map
(
i
=>
(
i
.
retailPrice
=
Number
(
i
.
retailPrice
).
toFixed
(
2
)))
...
...
pages/tab/index/index.scss
View file @
a9333c1
...
@@ -113,7 +113,6 @@ page {
...
@@ -113,7 +113,6 @@ page {
}
}
.special-sale-box
{
.special-sale-box
{
padding
:
0
20rpx
;
padding
:
0
20rpx
;
background-color
:
#F8F9FC
;
.item
{
.item
{
width
:
100%
;
width
:
100%
;
height
:
340rpx
;
height
:
340rpx
;
...
@@ -161,6 +160,6 @@ page {
...
@@ -161,6 +160,6 @@ page {
}
}
.sticky
{
.sticky
{
background
:
#F
9F7F7
;
background
:
#F
8F9FC
;
padding
:
10rpx
0
;
padding
:
10rpx
0
;
}
}
project.private.config.json
View file @
a9333c1
...
@@ -16,6 +16,13 @@
...
@@ -16,6 +16,13 @@
"miniprogram"
:
{
"miniprogram"
:
{
"list"
:
[
"list"
:
[
{
{
"name"
:
"pages/Login/Login"
,
"pathName"
:
"pages/Login/Login"
,
"query"
:
""
,
"scene"
:
null
,
"launchMode"
:
"default"
},
{
"name"
:
"积分中心"
,
"name"
:
"积分中心"
,
"pathName"
:
"packageIndex/pages/integral/index/index"
,
"pathName"
:
"packageIndex/pages/integral/index/index"
,
"query"
:
""
,
"query"
:
""
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment