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
d1ec7fc9
Commit
d1ec7fc9
authored
Mar 01, 2024
by
侯体倬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购 id 处理
parent
7e6b25f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
29 deletions
+41
-29
src/components/tabbarPage.vue
+6
-0
src/pages/index/index.vue
+9
-0
src/utils/request.js
+26
-29
No files found.
src/components/tabbarPage.vue
View file @
d1ec7fc9
...
@@ -78,6 +78,12 @@ export default {
...
@@ -78,6 +78,12 @@ export default {
if
(
wx
.
getStorageSync
(
"workBox"
)){
if
(
wx
.
getStorageSync
(
"workBox"
)){
this
.
params
+=
`&workBox=
${
wx
.
getStorageSync
(
"workBox"
)}
`
this
.
params
+=
`&workBox=
${
wx
.
getStorageSync
(
"workBox"
)}
`
}
}
// 判断当前是否为导购分享
const
guideEmployeeId
=
wx
.
getStorageSync
(
this
.
$store
.
state
.
mixid
+
'guideEmployeeId'
);
if
(
guideEmployeeId
)
{
this
.
params
+=
`&setGuideEmployeeId=
${
guideEmployeeId
}
`
;
}
// tabbar 跳转
// tabbar 跳转
let
homeIndex
=
checkTabbarPage
(
"/"
);
let
homeIndex
=
checkTabbarPage
(
"/"
);
console
.
log
(
homeIndex
,
tabIndex
,
'--tabIndex'
)
console
.
log
(
homeIndex
,
tabIndex
,
'--tabIndex'
)
...
...
src/pages/index/index.vue
View file @
d1ec7fc9
...
@@ -83,6 +83,11 @@ export default {
...
@@ -83,6 +83,11 @@ export default {
let
{
latitude
,
longitude
}
=
locationObj
;
let
{
latitude
,
longitude
}
=
locationObj
;
this
.
params
+=
`&latitude=
${
latitude
}
&longitude=
${
longitude
}
`
this
.
params
+=
`&latitude=
${
latitude
}
&longitude=
${
longitude
}
`
}
}
// 判断当前是否为导购分享
const
guideEmployeeId
=
wx
.
getStorageSync
(
this
.
$store
.
state
.
mixid
+
'guideEmployeeId'
);
if
(
guideEmployeeId
)
{
this
.
params
+=
`&setGuideEmployeeId=
${
guideEmployeeId
}
`
;
}
console
.
log
(
this
.
link
,
'======='
,
this
.
page
,
'++++++++++++++'
,
this
.
params
,
'************'
)
console
.
log
(
this
.
link
,
'======='
,
this
.
page
,
'++++++++++++++'
,
this
.
params
,
'************'
)
let
pageUrl1
=
(
this
.
page
.
startsWith
(
'http://'
)
||
this
.
page
.
startsWith
(
'https://'
))?
(
this
.
page
+
this
.
params
)
:
this
.
link
+
this
.
page
+
this
.
params
let
pageUrl1
=
(
this
.
page
.
startsWith
(
'http://'
)
||
this
.
page
.
startsWith
(
'https://'
))?
(
this
.
page
+
this
.
params
)
:
this
.
link
+
this
.
page
+
this
.
params
console
.
log
(
pageUrl1
,
'--------pageUrl1--'
)
console
.
log
(
pageUrl1
,
'--------pageUrl1--'
)
...
@@ -339,6 +344,10 @@ export default {
...
@@ -339,6 +344,10 @@ export default {
offlineShopName
:
paramsObj
.
offlineShopName
,
offlineShopName
:
paramsObj
.
offlineShopName
,
});
});
}
}
// 判断是否为导购分享进入
if
(
paramsObj
.
guideEmployeeId
)
{
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'guideEmployeeId'
,
paramsObj
.
guideEmployeeId
);
}
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
paramsObj
.
attractingCustomerChannelId
);
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
paramsObj
.
attractingCustomerChannelId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
paramsObj
.
storeId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
paramsObj
.
storeId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'sellerId'
,
paramsObj
.
sellerId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'sellerId'
,
paramsObj
.
sellerId
);
...
...
src/utils/request.js
View file @
d1ec7fc9
import
store
from
'../store/index'
import
store
from
'../store/index'
console
.
log
(
store
.
state
.
mixid
,
'store.state'
)
// 获取请求头
let
shopMixid
=
store
.
state
.
mixid
;
const
getRequestHeader
=
(
extraHeader
=
{})
=>
{
// 共用请求头
const
BASE_HEADER
=
{
"Shop-Mixid"
:
store
.
state
.
mixid
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Area-Id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
id
:
''
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
}
// 判断是否存在导购员 id
const
guideEmployeeId
=
wx
.
getStorageSync
(
store
.
state
.
mixid
+
'guideEmployeeId'
);
if
(
guideEmployeeId
)
{
BASE_HEADER
[
'Guide-Employee-Id'
]
=
guideEmployeeId
;
}
return
Object
.
assign
(
BASE_HEADER
,
extraHeader
);
}
// wx.getStore
export
async
function
requestGET
(
url
,
options
)
{
export
async
function
requestGET
(
url
,
options
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -11,14 +27,7 @@ export async function requestGET(url, options) {
...
@@ -11,14 +27,7 @@ export async function requestGET(url, options) {
url
:
url
,
url
:
url
,
data
:
options
,
data
:
options
,
method
:
"GET"
,
method
:
"GET"
,
header
:
{
header
:
getRequestHeader
(),
"Shop-Mixid"
:
store
.
state
.
mixid
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
"Area-Id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
id
:
''
,
// "dubbo-tag": "ljx"
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
resolve
(
res
)
resolve
(
res
)
},
},
...
@@ -41,15 +50,9 @@ export async function requestPOST(url, options) {
...
@@ -41,15 +50,9 @@ export async function requestPOST(url, options) {
url
:
url
,
url
:
url
,
data
:
options
,
data
:
options
,
method
:
"POST"
,
method
:
"POST"
,
header
:
{
header
:
getRequestHeader
({
"Shop-Mixid"
:
store
.
state
.
mixid
,
openId
:
wx
.
getStorageSync
(
"openid"
)
||
''
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
}),
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"openId"
:
wx
.
getStorageSync
(
"openid"
)
||
''
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
"Area-Id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
id
:
''
,
// "dubbo-tag": "ljx"
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
resolve
(
res
)
resolve
(
res
)
},
},
...
@@ -72,15 +75,9 @@ export function requestPOST1(url, options) {
...
@@ -72,15 +75,9 @@ export function requestPOST1(url, options) {
url
:
url
,
url
:
url
,
data
:
options
,
data
:
options
,
method
:
"POST"
,
method
:
"POST"
,
header
:
{
header
:
getRequestHeader
({
"Content-Type"
:
"application/x-www-form-urlencoded"
,
"Content-Type"
:
"application/x-www-form-urlencoded"
"Shop-Mixid"
:
store
.
state
.
mixid
,
}),
Authorization
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
"Area-Id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
id
:
''
,
// "dubbo-tag": "ljx"
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
resolve
(
res
)
resolve
(
res
)
},
},
...
...
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