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
d6e3c4c4
Commit
d6e3c4c4
authored
Aug 29, 2024
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: 非常用地提示
parent
cff7e169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
33 deletions
+57
-33
src/main.js
+19
-19
src/pages/login/index.vue
+38
-14
No files found.
src/main.js
View file @
d6e3c4c4
...
...
@@ -50,25 +50,25 @@ mpAnalytics.init({
Vue
.
prototype
.
$mpAnalytics
=
mpAnalytics
;
// 神策埋点
let
sensors
=
require
(
'../node_modules/sa-sdk-miniprogram/sensorsdata.min.js'
);
sensors
.
setPara
({
name
:
'sensors'
,
server_url
:
process
.
env
.
CLK_LOG_URL
,
// 全埋点控制开关
autoTrack
:
{
appLaunch
:
true
,
// 默认为 true,false 则关闭 $MPLaunch 事件采集
appShow
:
true
,
// 默认为 true,false 则关闭 $MPShow 事件采集
appHide
:
true
,
// 默认为 true,false 则关闭 $MPHide 事件采集
pageShow
:
true
,
// 默认为 true,false 则关闭 $MPViewScreen 事件采集
pageShare
:
true
,
// 默认为 true,false 则关闭 $MPShare 事件采集
mpClick
:
true
,
// 默认为 false,true 则开启 $MPClick 事件采集
mpFavorite
:
true
,
// 默认为 true,false 则关闭 $MPAddFavorites 事件采集
pageLeave
:
true
,
// 默认为 false, true 则开启 $MPPageLeave事件采集
},
show_log
:
true
});
sensors
.
init
();
Vue
.
prototype
.
$sensors
=
sensors
;
//
let sensors = require('../node_modules/sa-sdk-miniprogram/sensorsdata.min.js');
//
sensors.setPara({
//
name: 'sensors',
//
server_url: process.env.CLK_LOG_URL,
//
// 全埋点控制开关
//
autoTrack: {
//
appLaunch: true, // 默认为 true,false 则关闭 $MPLaunch 事件采集
//
appShow: true, // 默认为 true,false 则关闭 $MPShow 事件采集
//
appHide: true, // 默认为 true,false 则关闭 $MPHide 事件采集
//
pageShow: true, // 默认为 true,false 则关闭 $MPViewScreen 事件采集
//
pageShare: true, // 默认为 true,false 则关闭 $MPShare 事件采集
//
mpClick: true, // 默认为 false,true 则开启 $MPClick 事件采集
//
mpFavorite: true, // 默认为 true,false 则关闭 $MPAddFavorites 事件采集
//
pageLeave: true, // 默认为 false, true 则开启 $MPPageLeave事件采集
//
},
//
show_log: true
//
});
//
sensors.init();
Vue
.
prototype
.
$sensors
=
""
;
const
app
=
new
Vue
(
App
)
...
...
src/pages/login/index.vue
View file @
d6e3c4c4
...
...
@@ -891,6 +891,7 @@ export default {
loginIn
(
a
)
{
let
val
=
a
.
val
;
let
loginType
=
a
.
type
;
let
_this
=
this
;
wx
.
setStorage
({
key
:
"enterpriseAccount"
,
data
:
""
...
...
@@ -922,21 +923,44 @@ export default {
.
then
(
res
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
this
.
sessionId
=
res
.
data
.
data
.
sessionId
||
''
;
this
.
backParams
+=
`&sessionid=
${
res
.
data
.
data
.
sessionId
}
&needCertified=
${
res
.
data
.
data
.
NEED_CERTIFIED
}
`
;
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
console
.
log
(
this
.
mpApp
.
globalData
.
shopInfo
,
"------------------this.mpApp.globalData.shopInfo"
)
if
(
this
.
whetherOpenEnterprisesWantGoods
==
1
&&
res
.
data
.
data
.
masterAccount
&&
res
.
data
.
data
.
masterAccount
.
length
>
0
){
this
.
selectEnterpriseAccountOpenType
=
0
;
this
.
$refs
.
SelectEnterpriseAccount
.
open
(
res
.
data
.
data
.
masterAccount
);
}
else
{
wx
.
setStorage
({
key
:
"sessionid"
,
data
:
res
.
data
.
data
.
sessionId
if
(
res
.
data
.
data
.
isCommonlyUsedLocationLogin
==
'false'
)
{
wx
.
showModal
({
content
:
`当前账号处于非常用地`
,
confirmText
:
"确认"
,
cancelText
:
"取消"
,
showCancel
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
//点击“确认”时打开设置页面
if
(
res
.
confirm
)
{
console
.
log
(
"用户点击确认"
);
login
();
}
else
{
console
.
log
(
"用户点击取消"
);
login
();
}
}
});
this
.
pushPageType
();
}
else
{
login
();
}
let
login
=
()
=>
{
_this
.
sessionId
=
res
.
data
.
data
.
sessionId
||
''
;
_this
.
backParams
+=
`&sessionid=
${
res
.
data
.
data
.
sessionId
}
&needCertified=
${
res
.
data
.
data
.
NEED_CERTIFIED
}
`
;
_this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
console
.
log
(
_this
.
mpApp
.
globalData
.
shopInfo
,
"------------------_this.mpApp.globalData.shopInfo"
)
if
(
_this
.
whetherOpenEnterprisesWantGoods
==
1
&&
res
.
data
.
data
.
masterAccount
&&
res
.
data
.
data
.
masterAccount
.
length
>
0
){
_this
.
selectEnterpriseAccountOpenType
=
0
;
_this
.
$refs
.
SelectEnterpriseAccount
.
open
(
res
.
data
.
data
.
masterAccount
);
}
else
{
wx
.
setStorage
({
key
:
"sessionid"
,
data
:
res
.
data
.
data
.
sessionId
});
_this
.
pushPageType
();
}
}
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
})
...
...
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