Commit 3958072e by 匡雅琴

方案介绍tab栏切换

1 parent 8d97c3a1
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);
......
...@@ -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栏切换
......
...@@ -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>
......
<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>
......
...@@ -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;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!