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
f953e760
Commit
f953e760
authored
Apr 01, 2021
by
张卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定分销关系
parent
d538278f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
src/pages/home/index.vue
+27
-7
src/pages/login/index.vue
+9
-0
src/utils/fenxiaoModel.js
+1
-1
No files found.
src/pages/home/index.vue
View file @
f953e760
...
...
@@ -7,7 +7,6 @@
<div
v-if=
"showSpokesManHome"
>
<get-index-homepage
class=
"getIndexHomePage"
></get-index-homepage>
</div>
{{
options
}}
<ThemeDataPlant></ThemeDataPlant>
<div
v-for=
"(item,index) in pageData"
:key=
"index"
>
<div
v-if=
"item.componentCode=='banner' && item.componentInfo.visible == 1"
>
...
...
@@ -211,6 +210,13 @@ export default {
}
},
onLoad
(
options
)
{
//进页面存储需要绑定的信息
if
(
options
.
userId
||
options
.
spokesmanRelId
)
{
wx
.
setStorage
({
key
:
"becomeInfo"
,
data
:
JSON
.
stringify
(
options
)
});
}
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
//来自用户登出
...
...
@@ -236,7 +242,7 @@ export default {
that
.
showMyCard
=
res
;
})
//获取分销信息
this
.
getSpokesmanInit
(
options
)
this
.
getSpokesmanInit
(
wx
.
getStorage
(
"becomeInfo"
)
)
}
else
{
let
footerVal
=
{...
app
.
globalData
.
footerVal
};
console
.
log
(
'"分销员中心"'
,
footerVal
)
...
...
@@ -354,8 +360,12 @@ export default {
getSpokesmanInit
(
extConfig
)
{
//绑定上下级关系
app
.
fenxiaoModel
.
becomeRelation
(
extConfig
).
then
(
res
=>
{
if
(
!
res
)
{
wx
.
removeStorage
({
key
:
"becomeInfo"
});
}
//获取分销基本信息
console
.
log
(
res
,
333333344444444
)
this
.
getSpokesmanInfo
(
extConfig
)
})
},
...
...
@@ -460,15 +470,25 @@ export default {
console
.
log
(
res
)
let
newHref
=
'/pages/home/main'
;
let
title
=
app
.
globalData
.
shopInfo
.
shopName
;
let
hasInvitationStatus
=
0
;
await
app
.
fenxiaoModel
.
getSpokesmanidByShare
().
then
(
data
=>
{
if
(
data
.
hasInvitationStatus
==
1
)
{
let
newData
=
{
hasInvitationStatus
=
data
.
hasInvitationStatus
;
})
await
app
.
fenxiaoModel
.
getSpokesmanInfo
().
then
(
data
=>
{
let
newData
=
{}
if
(
hasInvitationStatus
==
1
)
{
newData
=
{
spokesmanGroupId
:
data
.
groupId
,
spokesmanShopId
:
data
.
shopId
,
spokesmanRelId
:
data
.
spokesmanId
,
spokesmanRelId
:
data
.
id
,
userId
:
data
.
userId
}
}
else
{
newData
=
{
userId
:
data
.
userId
}
newHref
=
concatUrl
(
newHref
,
newData
)
}
newHref
=
concatUrl
(
newHref
,
newData
)
})
console
.
log
(
newHref
,
3333555666
,
title
,
res
)
return
{
...
...
src/pages/login/index.vue
View file @
f953e760
...
...
@@ -33,6 +33,7 @@ import login from "@/api/login";
import
shop
from
"@/api/shop"
;
import
indexApi
from
"@/api/index.js"
;
var
WXBizDataCrypt
=
require
(
"@/utils/WXBizDataCrypt"
);
const
app
=
getApp
();
export
default
{
name
:
'login'
,
components
:
{
...
...
@@ -311,6 +312,14 @@ export default {
},
// 是否跳转h5或小程序
pushPageType
(){
//绑定上下级关系
app
.
fenxiaoModel
.
becomeRelation
(
wx
.
getStorage
(
"becomeInfo"
)).
then
(
res
=>
{
if
(
!
res
)
{
wx
.
removeStorage
({
key
:
"becomeInfo"
});
}
})
if
(
this
.
fromType
==
'mini'
){
wx
.
navigateBack
({
delta
:
1
...
...
src/utils/fenxiaoModel.js
View file @
f953e760
...
...
@@ -89,7 +89,7 @@ class fenxiaoModel{
}
})
}
else
{
resolve
()
resolve
(
false
)
}
})
}
...
...
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