Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
hmd
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 aef08587
authored
Aug 14, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复
1 parent
d3effbfe
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
10 deletions
packageMall/pages/detail/detail.js
packageMine/pages/setting/index.js
pages/Login/Login.js
pages/loading/loading.js
pages/tab/index/components/banner/banner.js
pages/tab/index/components/banner/banner.wxml
router/router.js
packageMall/pages/detail/detail.js
View file @
aef0858
...
@@ -393,7 +393,9 @@ Page({
...
@@ -393,7 +393,9 @@ Page({
}
}
})
})
},
},
getGoodscouponList
(
id
)
{
async
getGoodscouponList
(
id
)
{
const
res
=
await
wx
.
p
.
router
.
intercept
(
false
)
if
(
res
)
return
id
=
id
?
id
:
this
.
data
.
id
id
=
id
?
id
:
this
.
data
.
id
wx
.
p
.
api
.
shopmallApi
wx
.
p
.
api
.
shopmallApi
.
getGoodscouponList
({
.
getGoodscouponList
({
...
@@ -513,6 +515,7 @@ Page({
...
@@ -513,6 +515,7 @@ Page({
*/
*/
onLoginSuccess
()
{
onLoginSuccess
()
{
this
.
getUserAddressDefault
()
this
.
getUserAddressDefault
()
this
.
getGoodscouponList
()
},
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
...
...
packageMine/pages/setting/index.js
View file @
aef0858
...
@@ -12,10 +12,11 @@ Page({
...
@@ -12,10 +12,11 @@ Page({
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
// wx.$Track.setTrack({}, 4)
// wx.$Track.setTrack({}, 4)
wx
.
$
auth
Status
=
true
wx
.
$
Login
Status
=
true
// wx.$util.removeSystemStorage()
// wx.$util.removeSystemStorage()
wx
.
p
.
storage
.
rm
(
'userInfo'
)
wx
.
p
.
storage
.
rm
(
'userInfo'
)
wx
.
p
.
storage
.
rm
(
'sessionId'
)
wx
.
p
.
storage
.
rm
(
'sessionId'
)
wx
.
p
.
storage
.
rm
(
'isVIP'
)
wx
.
p
.
router
.
back
(
prevPage
=>
{
wx
.
p
.
router
.
back
(
prevPage
=>
{
prevPage
.
setData
({
prevPage
.
setData
({
userInfo
:
null
,
userInfo
:
null
,
...
...
pages/Login/Login.js
View file @
aef0858
...
@@ -126,6 +126,9 @@ Page({
...
@@ -126,6 +126,9 @@ Page({
wx
.
hideLoading
()
wx
.
hideLoading
()
}
catch
(
error
)
{
}
catch
(
error
)
{
this
.
showTips
(
error
||
'服务不可用'
)
this
.
showTips
(
error
||
'服务不可用'
)
setTimeout
(()
=>
{
this
.
onLoad
()
},
1500
)
}
}
},
},
/**微信登录 */
/**微信登录 */
...
@@ -150,13 +153,15 @@ Page({
...
@@ -150,13 +153,15 @@ Page({
else
throw
message
else
throw
message
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
this
.
onLoad
()
this
.
showTips
(
error
||
'服务不可用'
)
this
.
showTips
(
error
||
'服务不可用'
)
setTimeout
(()
=>
{
this
.
onLoad
()
},
1500
)
}
}
},
},
/**C端登录回调 */
/**C端登录回调 */
customerLoginCallBack
(
data
)
{
customerLoginCallBack
(
data
)
{
wx
.
$
auth
Status
=
false
wx
.
$
Login
Status
=
false
wx
.
p
.
storage
.
set
(
'userInfo'
,
data
)
wx
.
p
.
storage
.
set
(
'userInfo'
,
data
)
wx
.
p
.
storage
.
set
(
'sessionId'
,
data
.
sessionId
)
wx
.
p
.
storage
.
set
(
'sessionId'
,
data
.
sessionId
)
// 返回上一页
// 返回上一页
...
...
pages/loading/loading.js
View file @
aef0858
...
@@ -36,7 +36,7 @@ Page({
...
@@ -36,7 +36,7 @@ Page({
data
,
data
,
message
message
}
=
await
wx
.
p
.
api
.
userApi
.
login
()
}
=
await
wx
.
p
.
api
.
userApi
.
login
()
wx
.
$
auth
Status
=
code
!=
0
wx
.
$
Login
Status
=
code
!=
0
if
(
data
)
wx
.
p
.
storage
.
set
(
'merchant_info'
,
{
if
(
data
)
wx
.
p
.
storage
.
set
(
'merchant_info'
,
{
merchantId
:
data
.
merchantId
,
merchantId
:
data
.
merchantId
,
merchantName
:
data
.
merchantName
merchantName
:
data
.
merchantName
...
@@ -48,6 +48,7 @@ Page({
...
@@ -48,6 +48,7 @@ Page({
}
else
{
}
else
{
wx
.
p
.
storage
.
rm
(
'userInfo'
)
wx
.
p
.
storage
.
rm
(
'userInfo'
)
wx
.
p
.
storage
.
rm
(
'sessionId'
)
wx
.
p
.
storage
.
rm
(
'sessionId'
)
}
}
console
.
log
(
'登陆信息:'
,
data
)
console
.
log
(
'登陆信息:'
,
data
)
if
(
options
.
url
)
{
if
(
options
.
url
)
{
...
@@ -56,6 +57,7 @@ Page({
...
@@ -56,6 +57,7 @@ Page({
// 默认跳转到首页
// 默认跳转到首页
wx
.
p
.
router
.
goHome
()
wx
.
p
.
router
.
goHome
()
}
catch
(
error
)
{
}
catch
(
error
)
{
wx
.
$LoginStatus
=
true
//请求失败默认未登录
console
.
log
(
error
)
console
.
log
(
error
)
wx
.
p
.
wxApi
.
showToast
(
String
(
error
))
wx
.
p
.
wxApi
.
showToast
(
String
(
error
))
wx
.
p
.
router
.
goHome
()
wx
.
p
.
router
.
goHome
()
...
...
pages/tab/index/components/banner/banner.js
View file @
aef0858
...
@@ -59,9 +59,10 @@ Component({
...
@@ -59,9 +59,10 @@ Component({
},
},
changePage
(
e
)
{
changePage
(
e
)
{
let
{
let
{
current
current
,
source
}
=
e
.
detail
}
=
e
.
detail
this
.
setData
({
if
(
source
==
'autoplay'
||
source
==
'touch'
)
this
.
setData
({
bannerIndex
:
current
bannerIndex
:
current
})
})
},
},
...
...
pages/tab/index/components/banner/banner.wxml
View file @
aef0858
<view class="banner">
<view class="banner">
<swiper class="swiper" bind
change
="changePage" autoplay interval="5000" current="{{bannerIndex}}">
<swiper class="swiper" bind
animationfinish
="changePage" autoplay interval="5000" current="{{bannerIndex}}">
<block wx:for="{{bannerList}}" wx:key="index">
<block wx:for="{{bannerList}}" wx:key="index">
<swiper-item>
<swiper-item>
<image webp src="{{item.bannerImg}}" class="banner-img" bindtap="jumpGoods" data-item="{{item}}" data-bannerType="{{item.bannerType}}" data-id="{{item.goods.id}}" data-url="{{item.linkUrl}}" data-equity="{{item.equity}}"></image>
<image webp src="{{item.bannerImg}}" class="banner-img" bindtap="jumpGoods" data-item="{{item}}" data-bannerType="{{item.bannerType}}" data-id="{{item.goods.id}}" data-url="{{item.linkUrl}}" data-equity="{{item.equity}}"></image>
...
...
router/router.js
View file @
aef0858
...
@@ -85,13 +85,14 @@ class Router {
...
@@ -85,13 +85,14 @@ class Router {
/**
/**
*
*
* @param {*} auto 是否自动跳转到登录,默认自动跳转
* @param {*} auto 是否自动跳转到登录,默认自动跳转
* @param {*} callBack true未登录 false已登录
*/
*/
async
intercept
(
auto
=
true
)
{
async
intercept
(
auto
=
true
)
{
const
authStatus
=
wx
.
$
authStatus
;
const
authStatus
=
wx
.
$
LoginStatus
if
(
authStatus
)
{
if
(
authStatus
)
{
if
(
auto
)
wx
.
navigateTo
({
if
(
auto
)
wx
.
navigateTo
({
url
:
'/pages/Login/Login'
,
url
:
'/pages/Login/Login'
,
})
;
})
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
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