Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3958072e
authored
Sep 05, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
方案介绍tab栏切换
1 parent
8d97c3a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
4 deletions
mixins/menuMixin.js
pages/tab/index/index.js
pages/tab/index/index.wxml
pages/template/menu/menu.wxml
pages/template/menu/menu.wxss
mixins/menuMixin.js
View file @
3958072
module
.
exports
=
Behavior
({
module
.
exports
=
Behavior
({
data
:
{
data
:
{
menuList
:
[
"企微魔方"
,
"数字化权益"
,
"智能线索"
,
"D+增值转化"
],
//
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
// templateMethods: [{"tap": "selectIntroduce"}],
// templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex
:
0
//
curIntroduceIndex: 0
},
},
// selectIntroduce(e) {
// selectIntroduce(e) {
// console.log(e.currentTarget);
// console.log(e.currentTarget);
...
...
pages/tab/index/index.js
View file @
3958072
...
@@ -39,6 +39,8 @@ Page({
...
@@ -39,6 +39,8 @@ Page({
curTabIndex
:
0
,
curTabIndex
:
0
,
curIntroduceIndex
:
0
,
curIntroduceIndex
:
0
,
templateMethods
:
[{
"tap"
:
"selectIntroduce"
}],
templateMethods
:
[{
"tap"
:
"selectIntroduce"
}],
// 0-员工,1-代理商
customerType
:
0
},
},
// tab栏切换
// tab栏切换
...
...
pages/tab/index/index.wxml
View file @
3958072
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<!-- 方案介绍 -->
<!-- 方案介绍 -->
<import src="../../template/menu/menu.wxml" />
<import src="../../template/menu/menu.wxml" />
<block wx:if="{{curTabIndex === 1 }}">
<block wx:if="{{curTabIndex === 1 }}">
<template is="menu" data="{{menuList, curIntroduceIndex}}"></template>
<template is="menu" data="{{menuList, curIntroduceIndex
, templateMethods, customerType
}}"></template>
</block>
</block>
<!-- 服务咨询 -->
<!-- 服务咨询 -->
<view>
<view>
...
...
pages/template/menu/menu.wxml
View file @
3958072
<template name="menu">
<template name="menu">
<view class="menu-list">
<view class="menu-list">
<block wx:for="{{menuList}}" wx:key="index">
<block wx:for="{{menuList}}" wx:key="index">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}}" bindtap="selectIntroduce" data-index="{{index}}">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}}
{{customerType === 1 && index === curIntroduceIndex ? 'menu-active-agency' : ''}}
" bindtap="selectIntroduce" data-index="{{index}}">
{{item}}
{{item}}
</view>
</view>
</block>
</block>
...
...
pages/template/menu/menu.wxss
View file @
3958072
...
@@ -11,7 +11,16 @@
...
@@ -11,7 +11,16 @@
}
}
.menu-active {
.menu-active {
color: #5850ff;
color: #5850ff;
font-weight: 500;
font-size: 28rpx;
}
}
.menu-active-agency {
font-weight: 600;
font-size: 32rpx;
color: #2D2D33;
}
.menu-active::after {
.menu-active::after {
content: '';
content: '';
display: inline-block;
display: inline-block;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment