Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
963044f0
Commit
963044f0
authored
Jan 20, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加log
parent
d3783440
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
30 deletions
+57
-30
src/pages/index/index.vue
+36
-21
src/pages/login/index.vue
+21
-9
No files found.
src/pages/index/index.vue
View file @
963044f0
This diff is collapsed.
Click to expand it.
src/pages/login/index.vue
View file @
963044f0
...
@@ -117,8 +117,9 @@ export default {
...
@@ -117,8 +117,9 @@ export default {
})
})
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
log
.
info
(
options
,
'----------------------login-options'
)
log
.
info
(
options
,
'----------------------login-o
nload-o
ptions'
)
login
.
getShopUserProtocol
().
then
(
res
=>
{
login
.
getShopUserProtocol
().
then
(
res
=>
{
log
.
info
(
'获取用户协议'
,
res
)
if
(
res
.
data
.
code
==
'200'
)
{
if
(
res
.
data
.
code
==
'200'
)
{
this
.
content
=
res
.
data
.
data
;
this
.
content
=
res
.
data
.
data
;
}
}
...
@@ -157,6 +158,7 @@ export default {
...
@@ -157,6 +158,7 @@ export default {
this
.
logoUrl
=
wx
.
getStorageSync
(
"logoUrl"
);
this
.
logoUrl
=
wx
.
getStorageSync
(
"logoUrl"
);
if
(
!
(
this
.
shopName
&&
this
.
logoUrl
))
{
if
(
!
(
this
.
shopName
&&
this
.
logoUrl
))
{
shop
.
getShopInfo
().
then
(
res
=>
{
shop
.
getShopInfo
().
then
(
res
=>
{
log
.
info
(
'获取商城信息'
,
res
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
this
.
shopName
=
res
.
data
.
data
.
shopName
;
this
.
shopName
=
res
.
data
.
data
.
shopName
;
this
.
logoUrl
=
process
.
env
.
IMG_DOMAIN
+
res
.
data
.
data
.
logoUrl
;
this
.
logoUrl
=
process
.
env
.
IMG_DOMAIN
+
res
.
data
.
data
.
logoUrl
;
...
@@ -176,15 +178,18 @@ export default {
...
@@ -176,15 +178,18 @@ export default {
init
()
{
init
()
{
let
_this
=
this
;
let
_this
=
this
;
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
l
ogin
l
et
query
=
{
.
miniLogin
({
code
:
this
.
code
,
code
:
this
.
code
,
spokesmanRelId
:
''
,
spokesmanRelId
:
''
,
spokesmanGroupId
:
''
,
spokesmanGroupId
:
''
,
spokesmanShopId
:
''
,
spokesmanShopId
:
''
,
nickname
:
_this
.
wxUserInfo
.
nickName
,
nickname
:
_this
.
wxUserInfo
.
nickName
,
headImgUrl
:
_this
.
wxUserInfo
.
avatarUrl
headImgUrl
:
_this
.
wxUserInfo
.
avatarUrl
})
};
login
.
miniLogin
(
query
)
.
then
(
res
=>
{
.
then
(
res
=>
{
log
.
info
(
'/wx/mini_login'
,
query
,
res
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
resolve
(
res
);
resolve
(
res
);
}
else
{
}
else
{
...
@@ -197,9 +202,9 @@ export default {
...
@@ -197,9 +202,9 @@ export default {
});
});
},
},
addRecord
(
flag
)
{
addRecord
(
flag
)
{
log
.
info
(
wx
.
getStorageSync
(
'attractingCustomerChannelId'
))
log
.
info
(
'attractingCustomerChannelId'
,
wx
.
getStorageSync
(
'attractingCustomerChannelId'
))
log
.
info
(
this
.
openid
)
log
.
info
(
'openid'
,
this
.
openid
)
log
.
info
(
99999
)
log
.
info
(
'addRecord'
,
flag
)
//埋点引客渠道
//埋点引客渠道
if
(
wx
.
getStorageSync
(
'attractingCustomerChannelId'
))
{
if
(
wx
.
getStorageSync
(
'attractingCustomerChannelId'
))
{
indexApi
.
addRecord
(
indexApi
.
addRecord
(
...
@@ -211,6 +216,7 @@ export default {
...
@@ -211,6 +216,7 @@ export default {
newRegisterFlag
:
flag
?
1
:
0
,
//1是新注册用户
newRegisterFlag
:
flag
?
1
:
0
,
//1是新注册用户
}
}
).
then
(
ele
=>
{
).
then
(
ele
=>
{
log
.
info
(
'addRecord'
,
res
)
if
(
ele
.
data
.
data
)
{
if
(
ele
.
data
.
data
)
{
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
)
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
)
}
}
...
@@ -218,6 +224,7 @@ export default {
...
@@ -218,6 +224,7 @@ export default {
}
}
},
},
getUserProfile
()
{
getUserProfile
()
{
log
.
info
(
'点击了微信一键登录'
);
let
_this
=
this
;
let
_this
=
this
;
if
(
this
.
content
&&!
this
.
checked
)
{
if
(
this
.
content
&&!
this
.
checked
)
{
wx
.
showToast
({
wx
.
showToast
({
...
@@ -236,6 +243,7 @@ export default {
...
@@ -236,6 +243,7 @@ export default {
desc
:
'用于完善会员资料'
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
desc
:
'用于完善会员资料'
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
(
e
)
=>
{
success
:
(
e
)
=>
{
_this
.
wxUserInfo
=
e
.
userInfo
;
_this
.
wxUserInfo
=
e
.
userInfo
;
log
.
info
(
'获取wx.getUserProfile用户信息'
,
_this
.
wxUserInfo
);
this
.
init
()
this
.
init
()
.
then
(
res
=>
{
.
then
(
res
=>
{
//存入openid
//存入openid
...
@@ -302,6 +310,7 @@ export default {
...
@@ -302,6 +310,7 @@ export default {
});
});
},
},
fail
:
(
e
)
=>
{
fail
:
(
e
)
=>
{
log
.
info
(
'wx.getUserProfile-fail'
,
e
)
wx
.
hideLoading
()
wx
.
hideLoading
()
}
}
})
})
...
@@ -320,6 +329,7 @@ export default {
...
@@ -320,6 +329,7 @@ export default {
login
login
.
checkUnionid
({
unionId
:
this
.
unionId
,
openId
:
this
.
openid
})
.
checkUnionid
({
unionId
:
this
.
unionId
,
openId
:
this
.
openid
})
.
then
(
res
=>
{
.
then
(
res
=>
{
log
.
info
(
'checkUnionid'
,
res
)
wx
.
hideLoading
();
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
isHaveUnion
==
"true"
)
{
if
(
res
.
data
.
data
.
isHaveUnion
==
"true"
)
{
...
@@ -469,11 +479,11 @@ export default {
...
@@ -469,11 +479,11 @@ export default {
query
.
spokesmanShopId
=
this
.
$store
.
state
.
spokesmanShopId
;
query
.
spokesmanShopId
=
this
.
$store
.
state
.
spokesmanShopId
;
}
}
log
.
info
(
query
,
"query"
);
login
login
.
bindUser
(
query
)
.
bindUser
(
query
)
.
then
(
res
=>
{
.
then
(
res
=>
{
//绑定成功
//绑定成功
log
.
info
(
'bindUser'
,
query
,
res
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'articleId'
,
false
)
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'articleId'
,
false
)
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
...
@@ -513,6 +523,7 @@ export default {
...
@@ -513,6 +523,7 @@ export default {
});
});
},
},
handbindHandle
()
{
handbindHandle
()
{
log
.
info
(
'点击手动绑定手机号'
)
log
.
info
(
this
.
queryOptions
,
'---------------options'
)
log
.
info
(
this
.
queryOptions
,
'---------------options'
)
const
query
=
{
const
query
=
{
openId
:
this
.
openid
,
openId
:
this
.
openid
,
...
@@ -526,7 +537,7 @@ export default {
...
@@ -526,7 +537,7 @@ export default {
param
:
this
.
queryOptions
.
param
,
param
:
this
.
queryOptions
.
param
,
back
:
this
.
queryOptions
.
back
,
back
:
this
.
queryOptions
.
back
,
};
};
log
.
info
(
query
,
'
-------------------519
'
)
log
.
info
(
query
,
'
handbindHandle-query
'
)
log
.
info
(
serialize
(
query
),
'------------------- serialize(query)'
)
log
.
info
(
serialize
(
query
),
'------------------- serialize(query)'
)
if
(
wx
.
getStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
))
{
if
(
wx
.
getStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
))
{
query
.
storeId
=
wx
.
getStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
)
query
.
storeId
=
wx
.
getStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
)
...
@@ -546,6 +557,7 @@ export default {
...
@@ -546,6 +557,7 @@ export default {
// wx.reLaunch({
// wx.reLaunch({
// url : '/pages/home/main'
// url : '/pages/home/main'
// })
// })
log
.
info
(
'点击暂不登录'
)
wx
.
navigateBack
({
wx
.
navigateBack
({
delta
:
1
delta
:
1
});
});
...
...
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