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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
50 deletions
+103
-50
src/components/tabbarPage.vue
+9
-7
src/pages/home/index.vue
+5
-3
src/pages/index/index.vue
+78
-32
src/pages/login/index.vue
+7
-6
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 {
},
},
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
let
ss
=
wx
.
getStorageSync
(
"sessionid"
);
this
.
ss
=
ss
?
`&sessionid=
${
ss
}
`
:
""
;
...
...
@@ -64,21 +65,22 @@ export default {
}
// tabbar 跳转
let
homeIndex
=
checkTabbarPage
(
"/"
);
homeIndex
!=
0
&&
homeIndex
==
this
.
index
&&
(
this
.
index
=
0
);
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
this
.
index
].
link
)
{
homeIndex
!=
0
&&
homeIndex
==
tabIndex
&&
(
tabIndex
=
0
);
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
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
);
let
query
=
serialize
(
options
)
console
.
log
(
query
,
'=================='
,
this
.
params
,
'-----------------'
)
this
.
params
+=
query
?
'&'
+
query
:
''
}
let
reg
=
/^
\/
pages
\/
/
;
console
.
log
(
this
.
pageUrl
,
'pageUrl======================'
,
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
)
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
)
{
if
(
reg
.
test
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
his
.
i
ndex
].
link
.
link
)){
console
.
log
(
this
.
pageUrl
,
'pageUrl======================'
,
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
)
if
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
)
{
if
(
reg
.
test
(
this
.
mpApp
.
globalData
.
footerVal
.
componentData
.
list
[
t
abI
ndex
].
link
.
link
)){
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 {
}
).
then
(
ele
=>
{
//清空引客渠道id
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
if
(
ele
.
data
.
data
)
{
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
}
})
}
}
...
...
@@ -444,7 +446,7 @@ export default {
(
data
.
visibleCopy
==
3
&&
!
wx
.
getStorageSync
(
'sessionid'
))
)
{
data
.
visible
=
1
;
}
else
if
((
data
.
visibleCopy
==
2
&&
!
wx
.
getStorageSync
(
'sessionid'
))
||
}
else
if
((
data
.
visibleCopy
==
2
&&
!
wx
.
getStorageSync
(
'sessionid'
))
||
(
data
.
visibleCopy
==
3
&&
wx
.
getStorageSync
(
'sessionid'
))
)
{
data
.
visible
=
0
;
...
...
@@ -470,7 +472,7 @@ export default {
(
element
.
visibleCopy
==
3
&&
!
wx
.
getStorageSync
(
'sessionid'
))
)
{
element
.
visible
=
1
;
}
else
if
((
element
.
visibleCopy
==
2
&&
!
wx
.
getStorageSync
(
'sessionid'
))
||
}
else
if
((
element
.
visibleCopy
==
2
&&
!
wx
.
getStorageSync
(
'sessionid'
))
||
(
element
.
visibleCopy
==
3
&&
wx
.
getStorageSync
(
'sessionid'
))
)
{
element
.
visible
=
0
;
...
...
src/pages/index/index.vue
View file @
3f2af358
...
...
@@ -82,10 +82,33 @@ 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
)
{
if
(
wx
.
getStorageSync
(
"sessionid"
))
{
//清空门店id
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
''
)
...
...
@@ -104,7 +127,7 @@ export default {
this
.
withoutScene
=
true
;
}
else
{
//获取openId
wx
.
login
({
wx
.
login
({
success
:
res
=>
{
this
.
code
=
res
.
code
;
console
.
log
(
this
.
code
,
'-----------------------------110---code'
)
...
...
@@ -119,7 +142,7 @@ export default {
this
.
withoutScene
=
true
;
})
},
})
})
}
// 移除重复参数
if
(
options
.
params
)
{
...
...
@@ -213,21 +236,44 @@ export default {
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
paramsObj
.
storeId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'sellerId'
,
paramsObj
.
sellerId
);
console
.
log
(
res
.
data
.
data
)
console
.
log
(
wx
.
getStorageSync
(
"openid"
))
console
.
log
(
333333
)
if
(
wx
.
getStorageSync
(
"openid"
))
{
indexApi
.
addRecord
(
{
attractingCustomersChannelId
:
paramsObj
.
attractingCustomerChannelId
,
miniOpenId
:
wx
.
getStorageSync
(
"openid"
),
registerFlag
:
1
,
newRegisterFlag
:
0
,
}
).
then
(
ele
=>
{
//清空引客渠道id
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
);
})
}
wx
.
login
({
success
:
res
=>
{
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
(
{
attractingCustomersChannelId
:
paramsObj
.
attractingCustomerChannelId
,
miniOpenId
:
res1
.
data
.
data
,
registerFlag
:
1
,
newRegisterFlag
:
0
,
}
).
then
(
ele
=>
{
if
(
ele
.
data
.
data
)
{
//清空引客渠道id
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
=
''
;
for
(
let
i
in
paramsObj
){
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
...
...
@@ -236,9 +282,9 @@ export default {
}
}).
catch
((
err
)
=>
{
this
.
withoutScene
=
true
;
})
})
});
}
else
{
//来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
...
...
@@ -255,12 +301,12 @@ export default {
// }else{
// this.params += `&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}`
// }
// }else if(querys.length == 3){
// this.params += `&userId=${querys[2]}`
// }
}
else
if
(
querys
[
0
]
==
"activty"
)
{
//活动页面activty_turntable_123
this
.
params
+=
`&pageInfo=
${
scene
}
`
;
...
...
@@ -274,11 +320,11 @@ export default {
// }else{
// this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}`
// }
// }else if(querys.length == 2){
// this.params += `&userId=${querys[1]}`
// }
}
else
if
(
querys
[
0
]
==
"home"
){
this
.
page
=
`/`
;
this
.
params
+=
this
.
paramsHander
(
querys
,
2
)
...
...
@@ -288,7 +334,7 @@ export default {
// }else{
// this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}`
// }
// }else if(querys.length == 2){
// this.params += `&userId=${querys[1]}`
// }
...
...
@@ -305,7 +351,7 @@ export default {
// }else{
// this.params += `&orderSn=${querys[1]}&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}`
// }
// }else if(querys.length == 3){
// this.params += `&orderSn=${querys[1]}&userId=${querys[2]}`
// }
...
...
@@ -328,8 +374,8 @@ export default {
console
.
log
(
this
.
page
)
console
.
log
(
this
.
params
)
}
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
this
.
init
();
...
...
@@ -415,7 +461,7 @@ export default {
console
.
log
(
res
,
"h5消息"
,
res
.
target
.
data
[
len
]);
this
.
shareShopName
=
res
.
target
.
data
[
len
].
shareShopName
||
""
;
this
.
shareLogoUrl
=
DFSImg
(
res
.
target
.
data
[
len
].
shareLogoUrl
,
500
,
400
);
//分享内容中有订单信息为送礼活动
this
.
shareOrderSn
=
res
.
target
.
data
[
len
].
orderSn
;
this
.
shareTid
=
res
.
target
.
data
[
len
].
shareTid
;
...
...
@@ -433,7 +479,7 @@ export default {
}
}
indexApi
.
forward
({
articleId
:
articleId
,}).
then
(
res
=>
{
})
}
},
...
...
@@ -470,7 +516,7 @@ export default {
}
else
{
params
+=
`&spokesmanGroupId=
${
querys
[
midNum
-
1
]}
&spokesmanShopId=
${
querys
[
midNum
]}
&spokesmanRelId=
${
querys
[
midNum
+
1
]}
`
}
}
else
if
(
querys
.
length
==
midNum
){
params
+=
`&userId=
${
querys
[
midNum
-
1
]}
`
}
...
...
@@ -534,7 +580,7 @@ export default {
}
else
{
this
.
shareUrl
=
url
;
}
console
.
log
(
this
.
shareUrl
,
"index12"
);
console
.
log
(
`/pages/index/main?share=
${
encodeURIComponent
(
this
.
shareUrl
)}
`
,
'测试直播分享相关'
)
...
...
src/pages/login/index.vue
View file @
3f2af358
...
...
@@ -205,12 +205,14 @@ export default {
{
attractingCustomersChannelId
:
wx
.
getStorageSync
(
'attractingCustomerChannelId'
),
miniOpenId
:
this
.
openid
,
unionId
:
this
.
unionId
,
registerFlag
:
1
,
newRegisterFlag
:
flag
?
1
:
0
,
//1是新注册用户
}
).
then
(
ele
=>
{
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
)
if
(
ele
.
data
.
data
)
{
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
''
)
}
})
}
},
...
...
@@ -340,7 +342,6 @@ export default {
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
wx
.
hideLoading
()
this
.
addRecord
(
true
)
}
}
})
...
...
@@ -353,7 +354,6 @@ export default {
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
wx
.
hideLoading
()
this
.
addRecord
(
true
)
}
}
...
...
@@ -516,13 +516,14 @@ export default {
const
query
=
{
openId
:
this
.
openid
,
unionId
:
this
.
unionId
,
headImgUrl
:
this
.
userInfo
.
avatarUrl
,
headImgUrl
:
encodeURIComponent
(
this
.
userInfo
.
avatarUrl
)
,
gender
:
this
.
userInfo
.
gender
,
nickname
:
this
.
userInfo
.
nickName
,
country
:
this
.
userInfo
.
country
,
province
:
this
.
userInfo
.
province
,
city
:
this
.
userInfo
.
city
,
...
this
.
queryOptions
,
param
:
this
.
queryOptions
.
param
,
back
:
this
.
queryOptions
.
back
,
};
console
.
log
(
query
,
'-------------------519'
)
console
.
log
(
serialize
(
query
),
'------------------- serialize(query)'
)
...
...
static/nativeComponents/Banner/index.wxml
View file @
3f2af358
...
...
@@ -9,7 +9,7 @@
duration="{{duration}}"
circular="true"
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">
<swiper-item data-item="{{item}}" bindtap="onClick">
...
...
static/nativeComponents/custom-tab-bar/index.wxss
View file @
3f2af358
...
...
@@ -1248,7 +1248,9 @@
}
.img-view{
margin:auto;
display: flex;
align-items: center;
justify-content: center;
}
.img-view image{
/* 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