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
3f2af358
Commit
3f2af358
authored
Dec 16, 2021
by
柳士祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nativehome_tst' of
http://code.mayi888.com/chengmo/mayi-mp-shop
into nativehome_tst
parents
2aa3458d
3765d75d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
18 deletions
+71
-18
src/components/tabbarPage.vue
+9
-7
src/pages/home/index.vue
+2
-0
src/pages/index/index.vue
+50
-4
src/pages/login/index.vue
+6
-5
static/nativeComponents/Banner/index.wxml
+1
-1
static/nativeComponents/custom-tab-bar/index.wxss
+3
-1
No files found.
src/components/tabbarPage.vue
View file @
3f2af358
...
@@ -51,6 +51,7 @@ export default {
...
@@ -51,6 +51,7 @@ export default {
},
},
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
let
tabIndex
=
this
.
index
>=
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
.
length
?
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
.
length
-
1
:
this
.
index
;
this
.
params
=
this
.
$options
.
data
.
call
(
this
).
params
this
.
params
=
this
.
$options
.
data
.
call
(
this
).
params
let
ss
=
wx
.
getStorageSync
(
"sessionid"
);
let
ss
=
wx
.
getStorageSync
(
"sessionid"
);
this
.
ss
=
ss
?
`&sessionid=
${
ss
}
`
:
""
;
this
.
ss
=
ss
?
`&sessionid=
${
ss
}
`
:
""
;
...
@@ -64,21 +65,22 @@ export default {
...
@@ -64,21 +65,22 @@ export default {
}
}
// tabbar 跳转
// tabbar 跳转
let
homeIndex
=
checkTabbarPage
(
"/"
);
let
homeIndex
=
checkTabbarPage
(
"/"
);
homeIndex
!=
0
&&
homeIndex
==
this
.
index
&&
(
this
.
index
=
0
);
homeIndex
!=
0
&&
homeIndex
==
tabIndex
&&
(
tabIndex
=
0
);
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
this
.
index
].
link
)
{
console
.
log
(
this
.
mpApp
.
globalData
.
footerVal
,
tabIndex
,
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
.
length
,
'--this.mpApp.globalData.footerVal'
)
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
tabIndex
].
link
)
{
this
.
page
=
getUrlofLink
(
this
.
page
=
getUrlofLink
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
);
);
let
query
=
serialize
(
options
)
let
query
=
serialize
(
options
)
console
.
log
(
query
,
'=================='
,
this
.
params
,
'-----------------'
)
console
.
log
(
query
,
'=================='
,
this
.
params
,
'-----------------'
)
this
.
params
+=
query
?
'&'
+
query
:
''
this
.
params
+=
query
?
'&'
+
query
:
''
}
}
let
reg
=
/^
\/
pages
\/
/
;
let
reg
=
/^
\/
pages
\/
/
;
console
.
log
(
this
.
pageUrl
,
'pageUrl======================'
,
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
)
console
.
log
(
this
.
pageUrl
,
'pageUrl======================'
,
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
)
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
)
{
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
)
{
if
(
reg
.
test
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
.
link
)){
if
(
reg
.
test
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
.
link
)){
wx
.
reLaunch
({
wx
.
reLaunch
({
url
:
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
.
link
,
url
:
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
.
link
,
});
});
}
}
}
}
...
...
src/pages/home/index.vue
View file @
3f2af358
...
@@ -299,7 +299,9 @@ export default {
...
@@ -299,7 +299,9 @@ export default {
}
}
).
then
(
ele
=>
{
).
then
(
ele
=>
{
//清空引客渠道id
//清空引客渠道id
if
(
ele
.
data
.
data
)
{
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
}
})
})
}
}
}
}
...
...
src/pages/index/index.vue
View file @
3f2af358
...
@@ -82,6 +82,29 @@ export default {
...
@@ -82,6 +82,29 @@ export default {
}
}
}
}
}
}
// 小程序登录绑定手机号后回调页面记录客流渠道记录数据。
if
(
wx
.
getStorageSync
(
'sessionid'
)
&&
wx
.
getStorageSync
(
'attractingCustomerChannelId'
)
&&
this
.
pageUrl
.
indexOf
(
'open_id'
)
!=
-
1
)
{
console
.
log
(
'绑定手机号后登陆回调页'
)
let
openId
=
this
.
pageUrl
.
split
(
'open_id='
)[
1
].
split
(
'&'
)[
0
]
let
unionId
=
null
if
(
this
.
pageUrl
.
split
(
'unionId='
)[
1
])
{
unionId
=
this
.
pageUrl
.
split
(
'unionId='
)[
1
].
split
(
'&'
)[
0
]
}
indexApi
.
addRecord
(
{
attractingCustomersChannelId
:
wx
.
getStorageSync
(
'attractingCustomerChannelId'
),
miniOpenId
:
openId
,
unionId
:
unionId
,
registerFlag
:
1
,
newRegisterFlag
:
0
,
}
).
then
(
ele
=>
{
if
(
ele
.
data
.
data
)
{
//清空引客渠道id
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
}
})
}
}
}
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
...
@@ -213,21 +236,44 @@ export default {
...
@@ -213,21 +236,44 @@ export default {
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
);
console
.
log
(
res
.
data
.
data
)
console
.
log
(
res
.
data
.
data
)
console
.
log
(
wx
.
getStorageSync
(
"openid"
))
wx
.
login
({
console
.
log
(
333333
)
success
:
res
=>
{
if
(
wx
.
getStorageSync
(
"openid"
))
{
login
.
get_open_id_by_code
({
code
:
res
.
code
}).
then
(
res1
=>
{
if
(
res1
.
data
.
code
==
200
)
{
wx
.
setStorageSync
({
key
:
"openid"
,
data
:
res1
.
data
.
data
});
console
.
log
(
'判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。'
)
if
(
wx
.
getStorageSync
(
'sessionid'
))
{
console
.
log
(
'已登陆了'
)
indexApi
.
addRecord
(
indexApi
.
addRecord
(
{
{
attractingCustomersChannelId
:
paramsObj
.
attractingCustomerChannelId
,
attractingCustomersChannelId
:
paramsObj
.
attractingCustomerChannelId
,
miniOpenId
:
wx
.
getStorageSync
(
"openid"
)
,
miniOpenId
:
res1
.
data
.
data
,
registerFlag
:
1
,
registerFlag
:
1
,
newRegisterFlag
:
0
,
newRegisterFlag
:
0
,
}
}
).
then
(
ele
=>
{
).
then
(
ele
=>
{
if
(
ele
.
data
.
data
)
{
//清空引客渠道id
//清空引客渠道id
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
}
})
})
}
else
{
console
.
log
(
'未登录过需要授权头像昵称信息。'
)
const
url
=
`/pages/login/main?back=
${
encodeURIComponent
(
this
.
page
)}
¶m=
${
encodeURIComponent
(
JSON
.
stringify
(
paramsObj
))
}
`
;
console
.
log
(
url
)
wx
.
navigateTo
({
url
});
}
}
}
})
},
})
let
params
=
''
;
let
params
=
''
;
for
(
let
i
in
paramsObj
){
for
(
let
i
in
paramsObj
){
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
...
...
src/pages/login/index.vue
View file @
3f2af358
...
@@ -205,12 +205,14 @@ export default {
...
@@ -205,12 +205,14 @@ export default {
{
{
attractingCustomersChannelId
:
wx
.
getStorageSync
(
'attractingCustomerChannelId'
),
attractingCustomersChannelId
:
wx
.
getStorageSync
(
'attractingCustomerChannelId'
),
miniOpenId
:
this
.
openid
,
miniOpenId
:
this
.
openid
,
unionId
:
this
.
unionId
,
registerFlag
:
1
,
registerFlag
:
1
,
newRegisterFlag
:
flag
?
1
:
0
,
//1是新注册用户
newRegisterFlag
:
flag
?
1
:
0
,
//1是新注册用户
}
}
).
then
(
ele
=>
{
).
then
(
ele
=>
{
if
(
ele
.
data
.
data
)
{
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
)
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
)
}
})
})
}
}
},
},
...
@@ -340,7 +342,6 @@ export default {
...
@@ -340,7 +342,6 @@ export default {
//不是会员需要绑定手机号
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
this
.
isShowPhone
=
true
;
wx
.
hideLoading
()
wx
.
hideLoading
()
this
.
addRecord
(
true
)
}
}
}
}
})
})
...
@@ -353,7 +354,6 @@ export default {
...
@@ -353,7 +354,6 @@ export default {
//不是会员需要绑定手机号
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
this
.
isShowPhone
=
true
;
wx
.
hideLoading
()
wx
.
hideLoading
()
this
.
addRecord
(
true
)
}
}
}
}
...
@@ -516,13 +516,14 @@ export default {
...
@@ -516,13 +516,14 @@ export default {
const
query
=
{
const
query
=
{
openId
:
this
.
openid
,
openId
:
this
.
openid
,
unionId
:
this
.
unionId
,
unionId
:
this
.
unionId
,
headImgUrl
:
this
.
userInfo
.
avatarUrl
,
headImgUrl
:
encodeURIComponent
(
this
.
userInfo
.
avatarUrl
)
,
gender
:
this
.
userInfo
.
gender
,
gender
:
this
.
userInfo
.
gender
,
nickname
:
this
.
userInfo
.
nickName
,
nickname
:
this
.
userInfo
.
nickName
,
country
:
this
.
userInfo
.
country
,
country
:
this
.
userInfo
.
country
,
province
:
this
.
userInfo
.
province
,
province
:
this
.
userInfo
.
province
,
city
:
this
.
userInfo
.
city
,
city
:
this
.
userInfo
.
city
,
...
this
.
queryOptions
,
param
:
this
.
queryOptions
.
param
,
back
:
this
.
queryOptions
.
back
,
};
};
console
.
log
(
query
,
'-------------------519'
)
console
.
log
(
query
,
'-------------------519'
)
console
.
log
(
serialize
(
query
),
'------------------- serialize(query)'
)
console
.
log
(
serialize
(
query
),
'------------------- serialize(query)'
)
...
...
static/nativeComponents/Banner/index.wxml
View file @
3f2af358
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
duration="{{duration}}"
duration="{{duration}}"
circular="true"
circular="true"
bindchange="bannerChange"
bindchange="bannerChange"
style="height:{{bannerHeight}};border-radius:{{datas.componentData.borderRadius
/3}}em
"
style="height:{{bannerHeight}};border-radius:{{datas.componentData.borderRadius
*2}}px
"
>
>
<block wx:for="{{newArr}}" wx:key="index">
<block wx:for="{{newArr}}" wx:key="index">
<swiper-item data-item="{{item}}" bindtap="onClick">
<swiper-item data-item="{{item}}" bindtap="onClick">
...
...
static/nativeComponents/custom-tab-bar/index.wxss
View file @
3f2af358
...
@@ -1248,7 +1248,9 @@
...
@@ -1248,7 +1248,9 @@
}
}
.img-view{
.img-view{
margin:auto;
display: flex;
align-items: center;
justify-content: center;
}
}
.img-view image{
.img-view image{
/* object-fit: contain; */
/* object-fit: contain; */
...
...
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