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
91e7e5ae
Commit
91e7e5ae
authored
Mar 04, 2021
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
2f23da9a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
2 deletions
+194
-2
src/pages/home/index.vue
+1
-0
src/pages/home/main.json
+1
-0
src/pages/index/index.vue
+1
-1
src/utils/mayi.js
+3
-1
static/nativeComponents/custom-tab-bar/index.js
+187
-0
static/nativeComponents/custom-tab-bar/index.wxss
+1
-0
No files found.
src/pages/home/index.vue
View file @
91e7e5ae
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
<bottomCont></bottomCont>
<bottomCont></bottomCont>
</div>
</div>
<share-popup></share-popup>
<share-popup></share-popup>
<custom-tab-bar></custom-tab-bar>
</div>
</div>
</
template
>
</
template
>
...
...
src/pages/home/main.json
View file @
91e7e5ae
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"van-tabs"
:
"/static/vant/tabs/index"
,
"van-tabs"
:
"/static/vant/tabs/index"
,
"van-tab"
:
"/static/vant/tab/index"
,
"van-tab"
:
"/static/vant/tab/index"
,
"banner"
:
"/static/nativeComponents/Banner/index"
,
"banner"
:
"/static/nativeComponents/Banner/index"
,
"custom-tab-bar"
:
"/static/nativeComponents/custom-tab-bar/index"
,
"goods-list"
:
"/static/nativeComponents/GoodsList/index"
,
"goods-list"
:
"/static/nativeComponents/GoodsList/index"
,
"time-limited-discount"
:
"/static/nativeComponents/TimeLimitedDiscount/index"
,
"time-limited-discount"
:
"/static/nativeComponents/TimeLimitedDiscount/index"
,
"waterfall-flow"
:
"/static/nativeComponents/module/WaterfallFlow/index"
,
"waterfall-flow"
:
"/static/nativeComponents/module/WaterfallFlow/index"
,
...
...
src/pages/index/index.vue
View file @
91e7e5ae
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
style=
"width:100%;height:90vh;display:flex;justify-content: center;align-items: center;"
>
<div
style=
"width:100%;height:90vh;display:flex;justify-content: center;align-items: center;"
>
<van-loading
size=
"40px"
type=
"spinner"
></van-loading>
<van-loading
size=
"40px"
type=
"spinner"
></van-loading>
</div>
</div>
<web-view
v-if=
"withoutScene"
:src=
"
pageUrl
"
@
message=
"getMessage"
@
error=
"handleError"
@
load=
"handleLoad"
></web-view>
<web-view
v-if=
"withoutScene"
:src=
"
'https://test-m-shop.mayi888.cn/?mixid=antgood'
"
@
message=
"getMessage"
@
error=
"handleError"
@
load=
"handleLoad"
></web-view>
</div>
</div>
</
template
>
</
template
>
...
...
src/utils/mayi.js
View file @
91e7e5ae
...
@@ -48,7 +48,9 @@ export function $themeToLink(data, option) {
...
@@ -48,7 +48,9 @@ export function $themeToLink(data, option) {
// wx.switchTab({
// wx.switchTab({
// url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`,
// url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`,
// })
// })
toPage
(
data
.
link
);
wx
.
redirectTo
({
url
:
`../index/main?from=home&backpath=
${
encodeURIComponent
(
parseLink
)}
`
})
return
return
}
}
// console.log(option, data,'---',parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`)
// console.log(option, data,'---',parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`)
...
...
static/nativeComponents/custom-tab-bar/index.js
0 → 100644
View file @
91e7e5ae
const
app
=
getApp
();
console
.
log
(
app
,
"apppppppppp"
);
Component
({
pageLifetimes
:
{
show
()
{
console
.
log
(
"哈哈哈哈"
);
if
(
typeof
this
.
getTabBar
===
"function"
&&
this
.
getTabBar
())
{
this
.
getTabBar
().
setData
({
selected
:
1
});
}
}
},
data
:
{
selected
:
0
,
color
:
"#7A7E83"
,
selectedColor
:
"#3cc51f"
,
list
:
[
{
pagePath
:
"/pages/home/main"
,
iconPath
:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png"
,
selectedIconPath
:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png"
,
text
:
"组件"
,
//--多主题
condition
:
""
,
icon
:
"ant-daishouhuo"
,
iconType
:
1
,
//0 iconfont 1 image
imgUrl
:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png"
,
selectImgUrl
:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png"
,
link
:
{
key
:
"1.1.1.7"
,
link
:
"/personalCenter/spokesmanCenter?distributionModel=1"
,
name
:
"分销商中心"
,
type
:
1
},
show
:
true
,
title
:
"分类页"
,
version
:
"1.0.0"
,
visible
:
1
},
{
pagePath
:
"/pages/index/main"
,
iconPath
:
"/static/images/bofang.png"
,
selectedIconPath
:
"/static/images/bofang.png"
,
text
:
"接口"
,
//--多主题
condition
:
""
,
icon
:
"ant-daishouhuo"
,
iconType
:
0
,
//0 iconfont 1 image
imgUrl
:
""
,
selectImgUrl
:
""
,
link
:
{},
show
:
true
,
title
:
"分类页"
,
version
:
"1.0.0"
,
visible
:
1
}
],
mm
:
false
,
componentData
:
{},
show
:
true
,
mmm
:
false
,
mainColor
:
""
,
showFlag
:
"up"
,
cartNum
:
0
},
ready
()
{
if
(
app
.
themeColor
[
"--main-color"
]
!=
"#ffffff"
)
{
this
.
setData
({
mainColor
:
app
.
themeColor
[
"--main-color"
]
});
}
else
{
app
.
themeColorCallBack
=
res
=>
{
this
.
setData
({
mainColor
:
res
[
"--main-color"
]
});
};
}
console
.
log
(
this
.
data
.
themeColor
,
"themeColor"
);
if
(
typeof
this
.
getTabBar
===
"function"
&&
this
.
getTabBar
())
{
this
.
getTabBar
().
setData
({
selected
:
1
});
}
this
.
setData
({
mmm
:
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
});
console
.
log
(
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
),
this
.
data
.
selected
);
console
.
log
(
this
.
data
.
mmm
,
"ready"
);
},
attached
()
{
let
that
=
this
;
if
(
app
.
globalData
.
footerVal
)
{
let
mm
=
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
app
.
globalData
.
footerVal
.
componentData
[
"styleSelectionNum"
]
==
1
;
console
.
log
(
733333
,
mm
);
that
.
setData
({
componentData
:
app
.
globalData
.
footerVal
.
componentData
,
list
:
app
.
globalData
.
footerVal
.
componentData
.
list
,
mm
:
mm
});
console
.
log
(
"777777"
,
Math
.
ceil
(
this
.
data
.
list
.
length
/
2
-
1
),
this
.
data
.
selected
,
this
.
data
.
componentData
[
"styleSelectionNum"
]
);
}
else
{
console
.
log
(
73333381
);
app
.
footerCallBack
=
function
(
params
)
{
console
.
log
(
"back"
);
that
.
setData
({
componentData
:
params
.
componentData
,
list
:
params
.
componentData
.
list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&¶ms.componentData['styleSelectionNum']==1)
});
let
mm
=
Math
.
ceil
(
params
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
params
.
componentData
[
"styleSelectionNum"
]
==
1
;
console
.
log
(
"87777777"
,
mm
);
};
}
// ----------webview 变化
console
.
log
(
"启动1111"
,
this
.
getTabBar
());
app
.
webviewCallBack
=
function
(
state
,
params
)
{
console
.
log
(
"webview变化"
,
state
,
params
);
};
//
this
.
setData
({
mm
:
Math
.
ceil
(
this
.
data
.
list
.
length
/
2
-
1
)
==
this
.
data
.
selected
&&
this
.
data
.
componentData
[
"styleSelectionNum"
]
==
1
});
},
methods
:
{
init
()
{},
switchTab
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
;
console
.
log
(
"755555555"
,
this
.
data
.
list
[
index
].
link
);
app
.
$themeToLink
(
this
.
data
.
list
[
index
][
"link"
],
1
);
// this.toPage(this.data.list[index].link,index)
// this.setData({
// selected: index
// })
},
toPage
(
data
,
index
)
{
console
.
log
(
"index98"
,
index
,
this
);
// index=index==0?index+1:index
// 跳转
if
(
data
.
link
==
"/"
)
{
wx
.
switchTab
({
url
:
"/pages/home/main"
});
}
else
{
wx
.
switchTab
({
url
:
`/pages/tabBar
${
index
}
/main`
});
// ?from=tabbar&backpath=${
// data.link
// }
}
}
}
});
static/nativeComponents/custom-tab-bar/index.wxss
View file @
91e7e5ae
...
@@ -1176,6 +1176,7 @@
...
@@ -1176,6 +1176,7 @@
left: 0;
left: 0;
background: #f5f5f4;
background: #f5f5f4;
/* border-top: 1px solid #e2e2e2; */
/* border-top: 1px solid #e2e2e2; */
z-index:999
}
}
/* .tab-bar-border {
/* .tab-bar-border {
...
...
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